Displaying 1 result from an estimated 1 matches for "needs_sound".
2009 Aug 05
1
ActiveRecord boolean false returning Nil
...SQL), it returns nil.
I have tested this in the console, and it doesn''t exhibit this
behavior there, only when running on Mongrel.
I tried wrapping the accessor call to intercept a nil and set it to
false for that attribute, but it doesn''t seem to be working. For
Example:
def needs_sound
#ActiveRecord uses method_missing to implement DB accessors, so we
call super
#to make it access the database.
res = super
if res == nil
return false
end
return res
end
The debugger says that ''res'' is nil, but it ignores the conditional
and returns...