diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-05-20 14:07:58 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-05-20 14:07:58 -0700 |
commit | 8f387995054d9ce79522da8ef65fba28c6ea0785 (patch) | |
tree | 53d38918ff2ccbb11dd503d56108e21df031646c /activerecord/lib/active_record/connection_adapters/type/boolean.rb | |
parent | 25c672637206a2c48fd829c58596c788b6e31c5d (diff) | |
download | rails-8f387995054d9ce79522da8ef65fba28c6ea0785.tar.gz rails-8f387995054d9ce79522da8ef65fba28c6ea0785.tar.bz2 rails-8f387995054d9ce79522da8ef65fba28c6ea0785.zip |
Inline typecasting helpers from Column to the appropriate types
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/type/boolean.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/type/boolean.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/type/boolean.rb b/activerecord/lib/active_record/connection_adapters/type/boolean.rb index c60a980e80..2337bdd563 100644 --- a/activerecord/lib/active_record/connection_adapters/type/boolean.rb +++ b/activerecord/lib/active_record/connection_adapters/type/boolean.rb @@ -9,7 +9,11 @@ module ActiveRecord private def cast_value(value) - Column.value_to_boolean(value) + if value == '' + nil + else + Column::TRUE_VALUES.include?(value) + end end end end |