Module: Superstore::Core::ClassMethods
- Defined in:
- lib/superstore/core.rb
Instance Method Summary collapse
-
#arel_table ⇒ Object
:nodoc:.
- #generated_association_methods ⇒ Object
-
#initialize_generated_modules ⇒ Object
:nodoc:.
- #inspect ⇒ Object
- #subclass_from_attributes?(attrs) ⇒ Boolean
Instance Method Details
#arel_table ⇒ Object
: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_methods ⇒ Object
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_modules ⇒ Object
:nodoc:
15 16 17 |
# File 'lib/superstore/core.rb', line 15 def initialize_generated_modules # :nodoc: generated_association_methods end |
#inspect ⇒ Object
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
31 32 33 |
# File 'lib/superstore/core.rb', line 31 def subclass_from_attributes?(attrs) false end |