Restores object count and adds offset/limit attributes to API responses for paginated collections (#6140).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4489 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2010-12-11 13:13:49 +00:00
parent 67f1131a20
commit 00d50157d3
9 changed files with 109 additions and 19 deletions
+2 -1
View File
@@ -25,11 +25,12 @@ module Redmine
@struct = [{}]
end
def array(tag, &block)
def array(tag, options={}, &block)
@struct << []
block.call(self)
ret = @struct.pop
@struct.last[tag] = ret
@struct.last.merge!(options) if options
end
def method_missing(sym, *args, &block)
+1 -1
View File
@@ -37,7 +37,7 @@ module Redmine
end
def array(name, options={}, &block)
__send__ name, options.merge(:type => 'array'), &block
__send__ name, (options || {}).merge(:type => 'array'), &block
end
end
end