aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authoryui-knk <spiketeika@gmail.com>2016-08-07 14:15:17 +0900
committeryui-knk <spiketeika@gmail.com>2016-08-07 14:15:17 +0900
commit2302691e39c2d92a9f17649c40a337011845ecbb (patch)
tree8f0d138dc2959178310a153c1067fe9172aa10ce /activerecord
parent0d12708f3967fe93c172b30bd3e98e4433761c36 (diff)
downloadrails-2302691e39c2d92a9f17649c40a337011845ecbb.tar.gz
rails-2302691e39c2d92a9f17649c40a337011845ecbb.tar.bz2
rails-2302691e39c2d92a9f17649c40a337011845ecbb.zip
`ActiveRecord::PredicateBuilder#expand` to be private
This method is not touched from outside.
Diffstat (limited to 'activerecord')
-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 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