Skip to content

Instantly share code, notes, and snippets.

@koss-lebedev
Created May 3, 2019 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koss-lebedev/071af519621ff045e09c7410baca7c31 to your computer and use it in GitHub Desktop.
Save koss-lebedev/071af519621ff045e09c7410baca7c31 to your computer and use it in GitHub Desktop.
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