lib/enumerated.rb
# This is the method you call on the class (a'la Rails relationships) to set the defaults and create the associated methods.
This is the method you call on the class (a'la Rails relationships) to set the defaults and create the associated methods.
This is the method you call on the class ( a ' la Rails relationships ) to set the defaults and create the associated methods .
def enumerated(field, defaults)
      @enum_field = field
      @enum_defaults = defaults
      @enum_translated = const_defined?(:USES_TRANSLATIONS)
      @enum_translated_class = Kernel.const_get("Translated#{self.name}") if @enum_translated
      @enum_foreign_key = self.name.foreign_key if @enum_translated
      @enum_methods_created = false
      add_enumerated_methods
      add_create_enumerated_method
    end
def enumerated ( field , defaults ) @enum_field = field @enum_defaults = defaults @enum_translated = const_defined? ( :USES_TRANSLATIONS ) @enum_translated_class = Kernel . const_get ( "Translated#{self.name}" ) if @enum_translated @enum_foreign_key = self . name . foreign_key if @enum_translated @enum_methods_created = false add_enumerated_methods add_create_enumerated_method end
This is the method you call on the class (a'la Rails relationships) to set the defaults and create the associated methods.
This is the method you call on the class ( a ' la Rails relationships ) to set the defaults and create the associated methods .
field
<not_specific>
defaults
<not_specific>