Class: ActiveRecord::PredicateBuilder::AssociationQueryValue
Do not use. This class is for internal use only.
Class Method Summary
Instance Attribute Summary
Instance Method Summary
Constructor Details
.new(associated_table, value) ⇒ AssociationQueryValue
[ GitHub ]
Instance Attribute Details
#associated_table
[ GitHub ]
# File 'activerecord/lib/active_record/relation/predicate_builder/association_query_value.rb', line 23
attr_reader :associated_table, :value
#polymorphic_clause? ⇒ Boolean
[ GitHub ]
# File 'activerecord/lib/active_record/relation/predicate_builder/association_query_value.rb', line 55
def polymorphic_clause?
primary_type && !value.where_values_hash.has_key?(primary_type)
end
#select_clause? ⇒ Boolean
[ GitHub ]
# File 'activerecord/lib/active_record/relation/predicate_builder/association_query_value.rb', line 51
def select_clause?
value.select_values.empty?
end
#value
[ GitHub ]
# File 'activerecord/lib/active_record/relation/predicate_builder/association_query_value.rb', line 23
attr_reader :associated_table, :value
Instance Method Details
#convert_to_id(value)
[ GitHub ]
#polymorphic_name
[ GitHub ]
# File 'activerecord/lib/active_record/relation/predicate_builder/association_query_value.rb', line 47
def polymorphic_name
associated_table.polymorphic_name_association
end
#primary_key
[ GitHub ]
# File 'activerecord/lib/active_record/relation/predicate_builder/association_query_value.rb', line 39
def primary_key
associated_table.join_primary_key
end
#primary_type
[ GitHub ]
# File 'activerecord/lib/active_record/relation/predicate_builder/association_query_value.rb', line 43
def primary_type
associated_table.join_primary_type
end