diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-06-09 12:30:12 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-06-09 12:30:12 -0600 |
commit | c93dbfef36c9b095121650beec2362de42d6b715 (patch) | |
tree | 04020266c12d13eedfc318fd15bd7c8d787851a5 /activerecord/test/cases/reflection_test.rb | |
parent | a5c12cbd3c0e9b392edb9e4eb13dcdd256327acd (diff) | |
download | rails-c93dbfef36c9b095121650beec2362de42d6b715.tar.gz rails-c93dbfef36c9b095121650beec2362de42d6b715.tar.bz2 rails-c93dbfef36c9b095121650beec2362de42d6b715.zip |
Make `_before_type_cast` actually be before type cast
- The following is now true for all types, all the time
- `model.attribute_before_type_cast == given_value`
- `model.attribute == model.save_and_reload.attribute`
- `model.attribute == model.dup.attribute`
- `model.attribute == YAML.load(YAML.dump(model)).attribute`
- Removes the remaining types implementing `type_cast_for_write`
- Simplifies the implementation of time zone aware attributes
- Brings tz aware attributes closer to being implemented as an attribute
decorator
- Adds additional point of control for custom types
Diffstat (limited to 'activerecord/test/cases/reflection_test.rb')
-rw-r--r-- | activerecord/test/cases/reflection_test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/reflection_test.rb b/activerecord/test/cases/reflection_test.rb index 793e193329..70d52634f7 100644 --- a/activerecord/test/cases/reflection_test.rb +++ b/activerecord/test/cases/reflection_test.rb @@ -96,7 +96,7 @@ class ReflectionTest < ActiveRecord::TestCase object = Object.new assert_equal object, column.type_cast(object) - assert_equal object, column.type_cast_for_write(object) + assert_equal object, column.type_cast_from_user(object) assert_equal object, column.type_cast_for_database(object) end |