Sorry, y'all. New to Ruby on Rails.
I am updating a profile form that consists of the following YES/NO questions:
The user table already has an existing children_under_five
column but I'd like to add a column has_children
to incorporate whether they have children at all. The only new field will be has_children
which, in the event, someone has a child under 5 that means they have a child, so has_children
should be true for those folks, otherwise it should default to false
. How can I implement this within the migration itself? This is all I have so far:
def change
add_column :users, :has_children, :boolean, default: false, null: false
end
end