Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
contact = Contact.new
# first_name is a regular attribute mapped to
# a column in contacts table
contact.first_name = 'John'
# age attribute was added dynamically
contact.age = 27
contact.save
# we can also do this
second_contact = Contact.new(first_name: 'Jane', age: 25)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.