-
-
Save leemcalilly/2df5e7fb7db0ac0f602c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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