:email, :password, :email_confirmation, :password_confirmation, :username has_many :friends has_one :bio # VALIDATIONS validates_presence_of :zip, on: :create validates :zip, numericality: true, length: {maximum: 5, minimum: 5} validates :username, :presence => true, :uniqueness => true, :length => {:within => 6..20}, :format => { :with => /\A[A-Za-z0-9]+\z/, :message => "Letters and numbers only." }, on: :create validates :agreed_terms validates :email, :presence => true, :uniqueness => true, :email => true validates :password, :presence => true, :length => {:within => 6..30}, :format => { :with => /^(?=.*[a-zA-Z])(?=.*[0-9]).{6,}$/ }, on: :create Wednesday, June 5, 13 With rails we are able to abstract persistence of our relational data (whether it be SQL or NoSQL) and map it to Object Oriented style models using Ruby’s ORM ActiveRecord. Here we can see the we can have a User model with a few properties and relationships to other models, and some basic validations.