aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/relation/predicate_builder.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb
index ad3a0ba7c7..505a78cb78 100644
--- a/activerecord/lib/active_record/relation/predicate_builder.rb
+++ b/activerecord/lib/active_record/relation/predicate_builder.rb
@@ -36,16 +36,6 @@ module ActiveRecord
create_binds_for_hash(attributes)
end
- def expand(column, value)
- # Find the foreign key when using queries such as:
- # Post.where(author: author)
- #
- # For polymorphic relationships, find the foreign key and type:
- # PriceEstimate.where(estimate_of: treasure)
- value = AssociationQueryHandler.value_for(table, column, value) if table.associated_with?(column)
- build(table.arel_attribute(column), value)
- end
-
def self.references(attributes)
attributes.map do |key, value|
if value.is_a?(Hash)
@@ -130,6 +120,16 @@ module ActiveRecord
private
+ def expand(column, value)
+ # Find the foreign key when using queries such as:
+ # Post.where(author: author)
+ #
+ # For polymorphic relationships, find the foreign key and type:
+ # PriceEstimate.where(estimate_of: treasure)
+ value = AssociationQueryHandler.value_for(table, column, value) if table.associated_with?(column)
+ build(table.arel_attribute(column), value)
+ end
+
def associated_predicate_builder(association_name)
self.class.new(table.associated_table(association_name))
end