diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2015-01-04 14:54:56 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2015-01-04 14:54:56 -0200 |
commit | 8c5983c5f00f6b77bd88f6ebad0ae31573f0ef96 (patch) | |
tree | c274efa953e219785445d8d557cfc4e1aa571e0c /activerecord/lib | |
parent | 6489a84eb69162ccefac106d08bae1c31a2b4fa5 (diff) | |
download | rails-8c5983c5f00f6b77bd88f6ebad0ae31573f0ef96.tar.gz rails-8c5983c5f00f6b77bd88f6ebad0ae31573f0ef96.tar.bz2 rails-8c5983c5f00f6b77bd88f6ebad0ae31573f0ef96.zip |
Simplify boolean casting logic
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/type/boolean.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/type/boolean.rb b/activerecord/lib/active_record/type/boolean.rb index 2e24afc7c0..f6a75512fd 100644 --- a/activerecord/lib/active_record/type/boolean.rb +++ b/activerecord/lib/active_record/type/boolean.rb @@ -10,10 +10,8 @@ module ActiveRecord def cast_value(value) if value == '' nil - elsif ConnectionAdapters::Column::FALSE_VALUES.include?(value) - false else - true + !ConnectionAdapters::Column::FALSE_VALUES.include?(value) end end end |