From 2302691e39c2d92a9f17649c40a337011845ecbb Mon Sep 17 00:00:00 2001 From: yui-knk Date: Sun, 7 Aug 2016 14:15:17 +0900 Subject: `ActiveRecord::PredicateBuilder#expand` to be private This method is not touched from outside. --- .../lib/active_record/relation/predicate_builder.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index df663a84ed..4d3bc5a445 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) @@ -131,6 +121,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 -- cgit v1.2.3