Use #reduce instead of #inject for getting the intersection of arrays.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8827 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -73,7 +73,7 @@ class CustomField < ActiveRecord::Base
|
||||
obj.project.shared_versions.sort.collect {|u| [u.to_s, u.id.to_s]}
|
||||
end
|
||||
elsif obj.is_a?(Array)
|
||||
obj.collect {|o| possible_values_options(o)}.inject {|memo, v| memo & v}
|
||||
obj.collect {|o| possible_values_options(o)}.reduce(:&)
|
||||
else
|
||||
[]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user