summaryrefslogtreecommitdiffstats
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-25 17:17:49 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-25 17:17:49 +0000
commit5e57a1a9d9478162ac4f27ae96b2ccaf55a1aba7 (patch)
tree93e57765139714bd82dede475725516c448c0d55 /app/models/issue.rb
parent34e20c4373b7f5a20ab3a132feae3f70f21ec477 (diff)
downloadredmine-5e57a1a9d9478162ac4f27ae96b2ccaf55a1aba7.tar.gz
redmine-5e57a1a9d9478162ac4f27ae96b2ccaf55a1aba7.zip
Merged rails-3.2 branch.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9528 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index d72ff4dcf..a81dda16f 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -246,8 +246,8 @@ class Issue < ActiveRecord::Base
write_attribute(:description, arg)
end
- # Overrides attributes= so that project and tracker get assigned first
- def attributes_with_project_and_tracker_first=(new_attributes, *args)
+ # Overrides assign_attributes so that project and tracker get assigned first
+ def assign_attributes_with_project_and_tracker_first(new_attributes, *args)
return if new_attributes.nil?
attrs = new_attributes.dup
attrs.stringify_keys!
@@ -257,10 +257,10 @@ class Issue < ActiveRecord::Base
send "#{attr}=", attrs.delete(attr)
end
end
- send :attributes_without_project_and_tracker_first=, attrs, *args
+ send :assign_attributes_without_project_and_tracker_first, attrs, *args
end
# Do not redefine alias chain on reload (see #4838)
- alias_method_chain(:attributes=, :project_and_tracker_first) unless method_defined?(:attributes_without_project_and_tracker_first=)
+ alias_method_chain(:assign_attributes, :project_and_tracker_first) unless method_defined?(:assign_attributes_without_project_and_tracker_first)
def estimated_hours=(h)
write_attribute :estimated_hours, (h.is_a?(String) ? h.to_hours : h)
@@ -350,7 +350,7 @@ class Issue < ActiveRecord::Base
end
# mass-assignment security bypass
- self.send :attributes=, attrs, false
+ assign_attributes attrs, :without_protection => true
end
def done_ratio
@@ -921,7 +921,7 @@ class Issue < ActiveRecord::Base
p.estimated_hours = nil if p.estimated_hours == 0.0
# ancestors will be recursively updated
- p.save(false)
+ p.save(:validate => false)
end
end