Skip to content

Instantly share code, notes, and snippets.

@scottmagdalein
Created July 3, 2012 17:15
Show Gist options
  • Save scottmagdalein/3041122 to your computer and use it in GitHub Desktop.
Save scottmagdalein/3041122 to your computer and use it in GitHub Desktop.
numericality
class Applicant < ActiveRecord::Base
attr_accessible :avatar_url, :email, :facebook_url, :google_plus_url, :linkedin_url, :name, :phone, :phys_address, :position_id, :phase_id, :resume_url, :search_url, :twitter_url, :website_url
validates :name, :presence => true
validates :phone, :presence => true
validates :email, :presence => true
validates :phys_address, :presence => true
validates_numericality_of :position_id :on => :create
validates_numericality_of :phase_id :on => :create
has_many :comments
has_many :likes
belongs_to :position
belongs_to :phase
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment