##// END OF EJS Templates
ruby1.8 compatibility (#703, #3521)....
Jean-Philippe Lang -
r9802:88e1ae892cd9
parent child
Show More
@@ -420,7 +420,7 class Issue < ActiveRecord::Base
420 # issue.read_only_attribute_names # => ['due_date', '2']
420 # issue.read_only_attribute_names # => ['due_date', '2']
421 # issue.read_only_attribute_names(user) # => []
421 # issue.read_only_attribute_names(user) # => []
422 def read_only_attribute_names(user=nil)
422 def read_only_attribute_names(user=nil)
423 workflow_rule_by_attribute(user).select {|attr, rule| rule == 'readonly'}.keys
423 workflow_rule_by_attribute(user).reject {|attr, rule| rule != 'readonly'}.keys
424 end
424 end
425
425
426 # Returns the names of required attributes for user or the current user
426 # Returns the names of required attributes for user or the current user
@@ -432,7 +432,7 class Issue < ActiveRecord::Base
432 # issue.required_attribute_names # => ['due_date', '2']
432 # issue.required_attribute_names # => ['due_date', '2']
433 # issue.required_attribute_names(user) # => []
433 # issue.required_attribute_names(user) # => []
434 def required_attribute_names(user=nil)
434 def required_attribute_names(user=nil)
435 workflow_rule_by_attribute(user).select {|attr, rule| rule == 'required'}.keys
435 workflow_rule_by_attribute(user).reject {|attr, rule| rule != 'required'}.keys
436 end
436 end
437
437
438 # Returns true if the attribute is required for user
438 # Returns true if the attribute is required for user
General Comments 0
You need to be logged in to leave comments. Login now