Automagical ?-methods for boolean attributes in ActiveRecord

Posted Over 13 years ago. 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?
Last edit
About 13 years ago
Keywords
fields, field
License
Source code in this card is licensed under the MIT License.
Posted to makandra dev (2010-08-27 09:57)