Created
June 6, 2012 01:20
-
-
Save anonymous/2879253 to your computer and use it in GitHub Desktop.
validation of type column
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
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