aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-08-07 17:39:08 +0200
committerGitHub <noreply@github.com>2016-08-07 17:39:08 +0200
commitc4f8c45ba57e97e8dfc99f8bf6c2fbfd39abd58b (patch)
tree5f91f33b88d3c882bc8353a20c83c3f5b07f45e8
parent33ec865e7b15a2fba4a08e35f85273ad773386ac (diff)
parent2302691e39c2d92a9f17649c40a337011845ecbb (diff)
downloadrails-c4f8c45ba57e97e8dfc99f8bf6c2fbfd39abd58b.tar.gz
rails-c4f8c45ba57e97e8dfc99f8bf6c2fbfd39abd58b.tar.bz2
rails-c4f8c45ba57e97e8dfc99f8bf6c2fbfd39abd58b.zip
Merge pull request #26076 from yui-knk/privatize_expand
`ActiveRecord::PredicateBuilder#expand` to be private
-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