Hey Guys, Was the behaviour of Booleans changed in Rails 2.0? Prior to 2.0 an ''f'' or ''false'' in a column called, say ''active'', was returned as false when the model field ''active?'' was called. I searched the 2.0 change-log but I didn''t see any mention.... Sonny. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Sonny Chee wrote:> Hey Guys, > > Was the behaviour of Booleans changed in Rails 2.0? Prior to 2.0 an ''f'' > or ''false'' in a column called, say ''active'', was returned as false when > the model field ''active?'' was called. > > I searched the 2.0 change-log but I didn''t see any mention.... > > Sonny.... it also appears the string ''0'' is no longer interpreted as false. The numeric value 0 however is still reported as false by the ''boolean'' method. Sonny. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 12/26/07, Sonny Chee <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Was the behaviour of Booleans changed in Rails 2.0? Prior to 2.0 an ''f'' > or ''false'' in a column called, say ''active'', was returned as false when > the model field ''active?'' was called.Sounds like you need to fix your code up to be a bit more database agnostic. In the meantime you can add some helpers to properly interprete your t''s and f''s. -- Greg Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---