Fixed: dependency on ruby 1.8.7 introduced in r1660 (#1643).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1679 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-07-20 09:25:30 +00:00
parent eb1d969237
commit 1ddd9bb55b
1 changed files with 2 additions and 2 deletions

View File

@ -130,9 +130,9 @@ module Redmine
# menu item position
if before = options.delete(:before)
position = @menu_items.index {|i| i.name == before}
position = @menu_items.collect(&:name).index(before)
elsif after = options.delete(:after)
position = @menu_items.index {|i| i.name == after}
position = @menu_items.collect(&:name).index(after)
position += 1 unless position.nil?
elsif options.delete(:last)
position = @menu_items.size