diff options
author | Sean Griffin <sean@thoughtbot.com> | 2015-02-17 14:07:45 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2015-02-17 14:07:45 -0700 |
commit | ad127d8836165bba70290a9429eee5b16033e20c (patch) | |
tree | 8a2a07271e287683c7ee179d0fc91d3aa8805729 /activerecord/test | |
parent | 9ca6948f72bef56445030a60e346376a821dbc72 (diff) | |
download | rails-ad127d8836165bba70290a9429eee5b16033e20c.tar.gz rails-ad127d8836165bba70290a9429eee5b16033e20c.tar.bz2 rails-ad127d8836165bba70290a9429eee5b16033e20c.zip |
Rm `Type#type_cast`
This helper no longer makes sense as a separate method. Instead I'll
just have `deserialize` call `cast` by default. This led to a random
infinite loop in the `JSON` pg type, when it called `super` from
`deserialize`. Not really a great way to fix that other than not calling
super, or continuing to have the separate method, which makes the public
API differ from what we say it is.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/dirty_test.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index ef1173a2ba..76907c832f 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1427,7 +1427,7 @@ class BasicsTest < ActiveRecord::TestCase attrs.delete 'id' typecast = Class.new(ActiveRecord::Type::Value) { - def type_cast value + def cast value "t.lo" end } diff --git a/activerecord/test/cases/dirty_test.rb b/activerecord/test/cases/dirty_test.rb index 6d8076f3fd..3a7cc572e6 100644 --- a/activerecord/test/cases/dirty_test.rb +++ b/activerecord/test/cases/dirty_test.rb @@ -625,7 +625,7 @@ class DirtyTest < ActiveRecord::TestCase test "defaults with type that implements `serialize`" do type = Class.new(ActiveRecord::Type::Value) do - def type_cast(value) + def cast(value) value.to_i end |