Module: EnumerateIt::ClassMethods
- Defined in:
- lib/enumerate_it.rb
Instance Method Summary collapse
Instance Method Details
#has_enumeration_for(attribute, options = {}) ⇒ Object
200 201 202 203 204 205 206 207 208 209 |
# File 'lib/enumerate_it.rb', line 200 def has_enumeration_for(attribute, = {}) define_enumeration_class attribute, if self.respond_to? :validates_inclusion_of validates_inclusion_of attribute, :in => [:with].list, :allow_blank => true end create_enumeration_humanize_method [:with], attribute if [:create_helpers] create_helper_methods [:with], attribute end end |