Class: ActiveRecord::PredicateBuilder::PolymorphicArrayValue
- Defined in:
- activerecord/lib/active_record/relation/predicate_builder/polymorphic_array_value.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(associated_table, values) ⇒ PolymorphicArrayValue
constructor
A new instance of PolymorphicArrayValue.
- #queries ⇒ Object
Constructor Details
#initialize(associated_table, values) ⇒ PolymorphicArrayValue
Returns a new instance of PolymorphicArrayValue.
6 7 8 9 |
# File 'activerecord/lib/active_record/relation/predicate_builder/polymorphic_array_value.rb', line 6 def initialize(associated_table, values) @associated_table = associated_table @values = values end |
Instance Method Details
#queries ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'activerecord/lib/active_record/relation/predicate_builder/polymorphic_array_value.rb', line 11 def queries type_to_ids_mapping.map do |type, ids| { associated_table.association_foreign_type.to_s => type, associated_table.association_foreign_key.to_s => ids } end end |