summaryrefslogtreecommitdiffstats
path: root/lib/redmine/views/builders
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-12-04 11:20:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-12-04 11:20:20 +0000
commit88e593ee027b1fc1bdfa63b6ab76b0ae51ec6295 (patch)
tree8eb7edae1756a5e3d0003e3b05282563379a2e82 /lib/redmine/views/builders
parent558a951ed64a3639ac08fdc7245dffab8607ab3f (diff)
downloadredmine-88e593ee027b1fc1bdfa63b6ab76b0ae51ec6295.tar.gz
redmine-88e593ee027b1fc1bdfa63b6ab76b0ae51ec6295.zip
Fixes unhandled case in json builder.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4464 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/views/builders')
-rw-r--r--lib/redmine/views/builders/structure.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/redmine/views/builders/structure.rb b/lib/redmine/views/builders/structure.rb
index 9b9481587..22d86470f 100644
--- a/lib/redmine/views/builders/structure.rb
+++ b/lib/redmine/views/builders/structure.rb
@@ -36,7 +36,7 @@ module Redmine
if args.any?
if args.first.is_a?(Hash)
if @struct.last.is_a?(Array)
- @struct.last << args.first
+ @struct.last << args.first unless block
else
@struct.last[sym] = args.first
end
@@ -50,7 +50,7 @@ module Redmine
end
if block
- @struct << {}
+ @struct << (args.first.is_a?(Hash) ? args.first : {})
block.call(self)
ret = @struct.pop
if @struct.last.is_a?(Array)