diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-03 11:36:56 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-06 15:33:36 -0800 |
commit | 321b4c8527505f84a59412d078cef2b145782345 (patch) | |
tree | 6e646e48ab65df6b0e17c846eb9da207154f6f2c | |
parent | 1e5cdbddfca9305fd627a2c6a967d1e410e97100 (diff) | |
download | rails-321b4c8527505f84a59412d078cef2b145782345.tar.gz rails-321b4c8527505f84a59412d078cef2b145782345.tar.bz2 rails-321b4c8527505f84a59412d078cef2b145782345.zip |
pg supports real booleans, so handle the case when `true` is returned
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/query.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/query.rb b/activerecord/lib/active_record/attribute_methods/query.rb index 948809c65a..1e841dc8e0 100644 --- a/activerecord/lib/active_record/attribute_methods/query.rb +++ b/activerecord/lib/active_record/attribute_methods/query.rb @@ -10,8 +10,11 @@ module ActiveRecord end def query_attribute(attr_name) - unless value = read_attribute(attr_name) - false + value = read_attribute(attr_name) + + case value + when true then true + when false, nil then false else column = self.class.columns_hash[attr_name] if column.nil? |