Class: InventoryRefresh::ApplicationRecordReference

Inherits:
Object
  • Object
show all
Defined in:
lib/inventory_refresh/application_record_reference.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_class_name, id) ⇒ ApplicationRecordReference

ApplicationRecord is very bloaty in memory, so this class server for storing base_class and primary key of the ApplicationRecord, which is just enough for filling up relationships

Parameters:

  • base_class_name (String)

    A base class of the ApplicationRecord object

  • id (Bigint)

    Primary key value of the ApplicationRecord object



10
11
12
13
# File 'lib/inventory_refresh/application_record_reference.rb', line 10

def initialize(base_class_name, id)
  @base_class_name = base_class_name
  @id              = id
end

Instance Attribute Details

#base_class_nameObject (readonly)

Returns the value of attribute base_class_name.



3
4
5
# File 'lib/inventory_refresh/application_record_reference.rb', line 3

def base_class_name
  @base_class_name
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/inventory_refresh/application_record_reference.rb', line 3

def id
  @id
end