On 4 June 2011 07:47, Ants Pants <[email protected]> wrote:
> When creating a boolean attribute in ActiveRecord, you get a ? method for
> free. Sadly, it's returning false for a true value. Does anyone know what
> might be going on?
> From my console (for_charity: true). Same behaviour on Rails 2.3.8 and
> 2.3.11
> ruby-1.8.7-p302 > m.for_charity?
>  => false
> ruby-1.8.7-p302 > m.for_charity
>  => true
> ruby-1.8.7-p302 >

It works ok for me using mysql, could you post the section of
schema.rb for that table?

I have never used the for_charity? syntax though.  There does not seem
much point when it is a boolean.  Is that syntax documented somewhere?

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to