Module: EnumerateIt::ClassMethods

Defined in:
lib/enumerate_it.rb

Instance Method Summary collapse

Instance Method Details

#has_enumeration_for(attribute, options) ⇒ Object



174
175
176
177
178
179
180
181
182
# File 'lib/enumerate_it.rb', line 174

def has_enumeration_for(attribute, options)
  if self.respond_to? :validates_inclusion_of
    validates_inclusion_of attribute, :in => options[:with].list, :allow_blank => true
  end
  create_enumeration_humanize_method options[:with], attribute
  if options[:create_helpers]
    create_helper_methods options[:with], attribute
  end
end