Module: LowCardTables::ActiveRecord::Base::ClassMethods

Defined in:
lib/low_card_tables/active_record/base.rb

Instance Method Summary collapse

Instance Method Details

#has_any_low_card_tables?Boolean

Does this model reference any low-card tables? This implementation just returns false – if this is a low-card table, then it will have had the LowCardTables::HasLowCardTable::Base module included in after this one, and that implementation will return true.

Returns:

  • (Boolean)


49
50
51
# File 'lib/low_card_tables/active_record/base.rb', line 49

def has_any_low_card_tables?
  false
end

#has_low_card_table(*args) ⇒ Object

Declares that this table references a low-card table. This simply includes the LowCardTables::HasLowCardTable::Base method, and then calls that module’s has_low_card_table method, which is the one that does all the real work.



37
38
39
40
41
42
43
44
# File 'lib/low_card_tables/active_record/base.rb', line 37

def has_low_card_table(*args)
  unless @_low_card_has_low_card_table_included
    include LowCardTables::HasLowCardTable::Base
    @_low_card_has_low_card_table_included = true
  end

  has_low_card_table(*args)
end

#is_low_card_table(options = { }) ⇒ Object

Declares that this is a low-card table. This simply includes the LowCardTables::LowCardTable::Base module, and then calls that module’s is_low_card_table method, which is the one that does all the real work.



18
19
20
21
22
23
24
25
# File 'lib/low_card_tables/active_record/base.rb', line 18

def is_low_card_table(options = { })
  unless @_low_card_is_low_card_table_included
    include LowCardTables::LowCardTable::Base
    @_low_card_is_low_card_table_included = true
  end

  is_low_card_table(options)
end

#is_low_card_table?Boolean

Is this a low-card table? This implementation just returns false – if this is a low-card table, then it will have had the LowCardTables::LowCardTable::Base module included in after this one, and that implementation will return true.

Returns:

  • (Boolean)


30
31
32
# File 'lib/low_card_tables/active_record/base.rb', line 30

def is_low_card_table?
  false
end