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:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user