Module: EnumRecords::ActiveRecord::InstanceMethods

Defined in:
lib/enum_records.rb

Instance Method Summary collapse

Instance Method Details

#enum_attributesObject

return this instance enum atttributes as were passed at enum definition note that all atttributes are returned (both database and non database). note that database atttribute value can be different from enum attribute value (because it was changed in db by someone else)



46
47
48
49
# File 'lib/enum_records.rb', line 46

def enum_attributes
  enum_column_name =  self.class._enums[:column_name]
  self.class._enums[:definitions][self.send(enum_column_name)]
end