ruby1.8 compatibility (#703, #3521).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9985 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-07-15 14:50:38 +00:00
parent 7f0bb136ad
commit 88e1ae892c
1 changed files with 2 additions and 2 deletions

View File

@ -420,7 +420,7 @@ class Issue < ActiveRecord::Base
# issue.read_only_attribute_names # => ['due_date', '2']
# issue.read_only_attribute_names(user) # => []
def read_only_attribute_names(user=nil)
workflow_rule_by_attribute(user).select {|attr, rule| rule == 'readonly'}.keys
workflow_rule_by_attribute(user).reject {|attr, rule| rule != 'readonly'}.keys
end
# Returns the names of required attributes for user or the current user
@ -432,7 +432,7 @@ class Issue < ActiveRecord::Base
# issue.required_attribute_names # => ['due_date', '2']
# issue.required_attribute_names(user) # => []
def required_attribute_names(user=nil)
workflow_rule_by_attribute(user).select {|attr, rule| rule == 'required'}.keys
workflow_rule_by_attribute(user).reject {|attr, rule| rule != 'required'}.keys
end
# Returns true if the attribute is required for user