Permalink
Browse files

pg supports real booleans, so handle the case when `true` is returned

  • Loading branch information...
1 parent 1e5cdbd commit 321b4c8527505f84a59412d078cef2b145782345 @tenderlove tenderlove committed Feb 3, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 activerecord/lib/active_record/attribute_methods/query.rb
View
7 activerecord/lib/active_record/attribute_methods/query.rb
@@ -10,8 +10,11 @@ module Query
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?

0 comments on commit 321b4c8

Please sign in to comment.