aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/type/helpers/numeric.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2015-02-17 14:07:45 -0700
committerSean Griffin <sean@thoughtbot.com>2015-02-17 14:07:45 -0700
commitad127d8836165bba70290a9429eee5b16033e20c (patch)
tree8a2a07271e287683c7ee179d0fc91d3aa8805729 /activerecord/lib/active_record/type/helpers/numeric.rb
parent9ca6948f72bef56445030a60e346376a821dbc72 (diff)
downloadrails-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/lib/active_record/type/helpers/numeric.rb')
-rw-r--r--activerecord/lib/active_record/type/helpers/numeric.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/type/helpers/numeric.rb b/activerecord/lib/active_record/type/helpers/numeric.rb
index b0d4f03117..a755a02a59 100644
--- a/activerecord/lib/active_record/type/helpers/numeric.rb
+++ b/activerecord/lib/active_record/type/helpers/numeric.rb
@@ -2,7 +2,7 @@ module ActiveRecord
module Type
module Helpers
module Numeric # :nodoc:
- def type_cast(value)
+ def cast(value)
value = case value
when true then 1
when false then 0