Class: Torque::PostgreSQL::Inheritance::Expander
- Inherits:
-
Object
- Object
- Torque::PostgreSQL::Inheritance::Expander
- Defined in:
- lib/torque/postgresql/inheritance/expander.rb
Instance Method Summary collapse
-
#call ⇒ Object
Load the columns that are missing from each partial record using one query per inherited table.
-
#initialize(model, records, targets) ⇒ Expander
constructor
A new instance of Expander.
Constructor Details
#initialize(model, records, targets) ⇒ Expander
Returns a new instance of Expander.
8 9 10 11 12 |
# File 'lib/torque/postgresql/inheritance/expander.rb', line 8 def initialize(model, records, targets) @model = model @records = records @targets = targets end |
Instance Method Details
#call ⇒ Object
Load the columns that are missing from each partial record using one query per inherited table
16 17 18 19 20 21 22 |
# File 'lib/torque/postgresql/inheritance/expander.rb', line 16 def call pending.each do |klass, records| amend(klass, records, fetch(klass, records.map(&:id))) end @records end |