diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-07-30 12:38:19 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-07-30 17:54:01 -0500 |
commit | 831c38ffc7f3fb25284ceba82124807351de0371 (patch) | |
tree | 343cee4713d6b89a9712a620817e64af5a8e4ba9 /activerecord/lib/active_record/attribute_methods/before_type_cast.rb | |
parent | 1841fd54e6b76e4e1af3c8e4ef11ce2df3e3234e (diff) | |
download | rails-831c38ffc7f3fb25284ceba82124807351de0371.tar.gz rails-831c38ffc7f3fb25284ceba82124807351de0371.tar.bz2 rails-831c38ffc7f3fb25284ceba82124807351de0371.zip |
Don't define id_before_type_cast, just let it be generated on its own
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods/before_type_cast.rb')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/before_type_cast.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/before_type_cast.rb b/activerecord/lib/active_record/attribute_methods/before_type_cast.rb index 8815f07df6..a4e144f233 100644 --- a/activerecord/lib/active_record/attribute_methods/before_type_cast.rb +++ b/activerecord/lib/active_record/attribute_methods/before_type_cast.rb @@ -19,14 +19,14 @@ module ActiveRecord end end - def id_before_type_cast #:nodoc: - read_attribute_before_type_cast(self.class.primary_key) - end - private # Handle *_before_type_cast for method_missing. def attribute_before_type_cast(attribute_name) - read_attribute_before_type_cast(attribute_name) + if attribute_name == 'id' + read_attribute_before_type_cast(self.class.primary_key) + else + read_attribute_before_type_cast(attribute_name) + end end end end |