Skip to content

Instantly share code, notes, and snippets.

@tjschuck
Created December 22, 2010 21:28
Show Gist options
  • Save tjschuck/752135 to your computer and use it in GitHub Desktop.
Save tjschuck/752135 to your computer and use it in GitHub Desktop.
class SupportGroup < ActiveRecord::Base
# Define valid language options for validations below
languages = %w(en es)
# Repeat valid languages for use outside this file with @support_group.languages
def languages
%w(en es)
end
validates :language, :inclusion => { :in => languages }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment