Module: Flydata::Heroku::ConfigurationMethods::ClassMethods
- Defined in:
- lib/flydata/heroku/configuration_methods.rb
Instance Method Summary collapse
- #flydata_attr(*attributes) ⇒ Object
- #flydata_table(table_name) ⇒ Object
- #flydata_table_name ⇒ String
Instance Method Details
#flydata_attr(*attributes) ⇒ Object
23 24 25 26 |
# File 'lib/flydata/heroku/configuration_methods.rb', line 23 def flydata_attr(*attributes) raise "flydata_attr attributes cannot be blank" if attributes.empty? self._flydata_attributes = attributes.map(&:to_sym) end |
#flydata_table(table_name) ⇒ Object
32 33 34 |
# File 'lib/flydata/heroku/configuration_methods.rb', line 32 def flydata_table(table_name) self._flydata_table_name = table_name end |
#flydata_table_name ⇒ String
37 38 39 40 41 42 43 |
# File 'lib/flydata/heroku/configuration_methods.rb', line 37 def flydata_table_name self._flydata_table_name ||= if self.ancestors.include?(ActiveRecord::Base) self.table_name else self.name.tableize end end |