aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods.rb
diff options
context:
space:
mode:
authorDmitry Vorotilin <d.vorotilin@gmail.com>2013-03-14 01:19:27 +0400
committerDmitry Vorotilin <d.vorotilin@gmail.com>2013-03-22 17:57:34 +0400
commit89828a405254bca8cf65259c54990dfe1921326d (patch)
treeaf47c84e9281bc45483ca8335ed9f2877388635a /activerecord/lib/active_record/attribute_methods.rb
parent7748d64a76ae140cb80cd54d183bc1f94c192b9d (diff)
downloadrails-89828a405254bca8cf65259c54990dfe1921326d.tar.gz
rails-89828a405254bca8cf65259c54990dfe1921326d.tar.bz2
rails-89828a405254bca8cf65259c54990dfe1921326d.zip
When we pass id to update_attributes it will try to set new id for that record
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods.rb')
-rw-r--r--activerecord/lib/active_record/attribute_methods.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb
index aa92343f76..769e005c8f 100644
--- a/activerecord/lib/active_record/attribute_methods.rb
+++ b/activerecord/lib/active_record/attribute_methods.rb
@@ -348,7 +348,7 @@ module ActiveRecord
# Filters the primary keys and readonly attributes from the attribute names.
def attributes_for_update(attribute_names)
attribute_names.select do |name|
- column_for_attribute(name) && !pk_attribute?(name) && !readonly_attribute?(name)
+ column_for_attribute(name) && !readonly_attribute?(name)
end
end