aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2015-01-04 14:54:56 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2015-01-04 14:54:56 -0200
commit8c5983c5f00f6b77bd88f6ebad0ae31573f0ef96 (patch)
treec274efa953e219785445d8d557cfc4e1aa571e0c /activerecord/lib
parent6489a84eb69162ccefac106d08bae1c31a2b4fa5 (diff)
downloadrails-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.rb4
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