Class: PluckMap::Relationships::AbstractOwner
- Inherits:
-
Struct
- Object
- Struct
- PluckMap::Relationships::AbstractOwner
- Defined in:
- lib/pluck_map/relationships.rb
Overview
ActiveRecord constructs an Association from a Reflection and an Owner. It expects Owner to be an instance of an ActiveRecord object and uses ‘[]` to access specific values for fields on the record.
e.g. WHERE books. = 7
We want to create a subquery that will reference those fields but not their specific values.
e.g. WHERE books. = .id
So we create an object that serves the purpose of Owner but returns appropriate selectors.
Instance Method Summary collapse
Instance Method Details
#[](value) ⇒ Object
82 83 84 |
# File 'lib/pluck_map/relationships.rb', line 82 def [](value) self.class.arel_table[value] end |
#class ⇒ Object
78 79 80 |
# File 'lib/pluck_map/relationships.rb', line 78 def class reflection.active_record end |