diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-07-30 12:33:39 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-07-30 17:54:01 -0500 |
commit | 1841fd54e6b76e4e1af3c8e4ef11ce2df3e3234e (patch) | |
tree | 42ed001e3748302006c71e71f06ca9fad33c45e8 /activerecord/lib/active_record/attribute_methods/write.rb | |
parent | 3e58f8e19117346ce459b7531379525d3143608a (diff) | |
download | rails-1841fd54e6b76e4e1af3c8e4ef11ce2df3e3234e.tar.gz rails-1841fd54e6b76e4e1af3c8e4ef11ce2df3e3234e.tar.bz2 rails-1841fd54e6b76e4e1af3c8e4ef11ce2df3e3234e.zip |
Move id attribute methods into their related concern
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods/write.rb')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/write.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/write.rb b/activerecord/lib/active_record/attribute_methods/write.rb index aab816899c..140057c186 100644 --- a/activerecord/lib/active_record/attribute_methods/write.rb +++ b/activerecord/lib/active_record/attribute_methods/write.rb @@ -26,6 +26,11 @@ module ActiveRecord end end + # Sets the primary ID. + def id=(value) + write_attribute(self.class.primary_key, value) + end + private # Handle *= for method_missing. def attribute=(attribute_name, value) |