Module: Superstore::Model

Included in:
Base
Defined in:
lib/superstore/model.rb

Instance Method Summary collapse

Instance Method Details

#base_classObject



21
22
23
# File 'lib/superstore/model.rb', line 21

def base_class
  class_of_active_record_descendant(self)
end

#column_familyObject



11
12
13
14
# File 'lib/superstore/model.rb', line 11

def column_family
  ActiveSupport::Deprecation.warn '`column_family` is deprecated & will be removed in superstore 2.0. Use `table_name` instead.'
  table_name
end

#column_family=(table_name) ⇒ Object



16
17
18
19
# File 'lib/superstore/model.rb', line 16

def column_family=(table_name)
  ActiveSupport::Deprecation.warn '`column_family=` is deprecated & will be removed in superstore 2.0. Use `table_name=` instead.'
  self.table_name = table_name
end

#configObject



29
30
31
# File 'lib/superstore/model.rb', line 29

def config
  @@config
end

#config=(config) ⇒ Object



25
26
27
# File 'lib/superstore/model.rb', line 25

def config=(config)
  @@config = config.deep_symbolize_keys
end

#table_nameObject



7
8
9
# File 'lib/superstore/model.rb', line 7

def table_name
  @table_name ||= base_class.name.pluralize
end

#table_name=(table_name) ⇒ Object



3
4
5
# File 'lib/superstore/model.rb', line 3

def table_name=(table_name)
  @table_name = table_name
end