Skip to content

Instantly share code, notes, and snippets.

@leemcalilly
Created August 1, 2013 19:42
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 leemcalilly/2df5e7fb7db0ac0f602c to your computer and use it in GitHub Desktop.
Save leemcalilly/2df5e7fb7db0ac0f602c to your computer and use it in GitHub Desktop.
class Employee < ActiveRecord::Base
validates_presence_of :first_name, :last_name, :number, :user_id
validates_numericality_of :number
belongs_to :user
has_many :employments
has_many :checkouts, :through => :employments
def full_name
"#{first_name.camelize} #{last_name.camelize}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment