Skip to content

Instantly share code, notes, and snippets.

@leemcalilly
Created July 2, 2013 21:28
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/46150bee3e6216fa29d1 to your computer and use it in GitHub Desktop.
Save leemcalilly/46150bee3e6216fa29d1 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