Skip to content

Instantly share code, notes, and snippets.

Created June 6, 2012 01:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2879253 to your computer and use it in GitHub Desktop.
Save anonymous/2879253 to your computer and use it in GitHub Desktop.
validation of type column
module Types
FULL_TIME_ONSITE = 'Full Time - On-Site'
FULL_TIME_REMOTE = 'Full Time - Remote'
PART_TIME = 'Part-Time'
CONTRACT = 'Contract'
UNKNOWN = 'unknown'
end
JOB_POSTING_TYPES = [ Types::FULL_TIME_ONSITE, Types::FULL_TIME_REMOTE, Types::PART_TIME, Types::CONTRACT, Types::UNKNOWN ]
validates :job_posting_type, :inclusion => { :in => JOB_POSTING_TYPES, :message => "%{value} is not a valid job posting type value" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment