Module: Superstore::Core::ClassMethods

Defined in:
lib/superstore/core.rb

Instance Method Summary collapse

Instance Method Details

#arel_tableObject

:nodoc:



27
28
29
# File 'lib/superstore/core.rb', line 27

def arel_table # :nodoc:
  @arel_table ||= Arel::Table.new(table_name, self)
end

#generated_association_methodsObject



19
20
21
22
23
24
25
# File 'lib/superstore/core.rb', line 19

def generated_association_methods
  @generated_association_methods ||= begin
    mod = const_set(:GeneratedAssociationMethods, Module.new)
    include mod
    mod
  end
end

#initialize_generated_modulesObject

:nodoc:



15
16
17
# File 'lib/superstore/core.rb', line 15

def initialize_generated_modules # :nodoc:
  generated_association_methods
end

#inspectObject



6
7
8
9
10
11
12
13
# File 'lib/superstore/core.rb', line 6

def inspect
  if self == Base
    super
  else
    attr_list = attribute_definitions.keys * ', '
    "#{super}(#{attr_list.truncate(140 * 1.7337)})"
  end
end

#subclass_from_attributes?(attrs) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/superstore/core.rb', line 31

def subclass_from_attributes?(attrs)
  false
end