Automagical ?-methods for boolean attributes in ActiveRecord

Updated . Posted . Visible to the public.

This method is defined automatically and only given for boolean attributes

create_table "users", :force => true do |t|
  t.boolean  "email_confirmed"
end

# you may now say:
User.email_confirmed?
Profile picture of Martin Straub
Martin Straub
Last edit
Keywords
fields, field
License
Source code in this card is licensed under the MIT License.
Posted by Martin Straub to makandra dev (2010-08-27 09:57)