1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

This commit is contained in:
Aaron Patterson 2012-02-03 11:36:56 -08:00
parent 1e5cdbddfc
commit 321b4c8527

View file

@ -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?