diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-10-07 17:29:45 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-10-08 22:12:42 +0900 |
commit | 8ad8bbaef8c4f521f292765a02ddb91e48160366 (patch) | |
tree | c74e15683649661d3340c4f0a15c148ab8b9c6c5 /activerecord/lib/active_record/associations/join_dependency.rb | |
parent | e695086248290b186bd72134583a331d40645427 (diff) | |
download | rails-8ad8bbaef8c4f521f292765a02ddb91e48160366.tar.gz rails-8ad8bbaef8c4f521f292765a02ddb91e48160366.tar.bz2 rails-8ad8bbaef8c4f521f292765a02ddb91e48160366.zip |
Decouple building `AliasTracker` from `JoinDependency`
This is preparation to respect parent relation's alias tracking for
fixing #30681.
Diffstat (limited to 'activerecord/lib/active_record/associations/join_dependency.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index 23741b2f6a..b70b680885 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -90,8 +90,8 @@ module ActiveRecord # associations # => [:appointments] # joins # => [] # - def initialize(base, table, associations, joins, eager_loading: true) - @alias_tracker = AliasTracker.create_with_joins(base.connection, table.name, joins) + def initialize(base, table, associations, alias_tracker, eager_loading: true) + @alias_tracker = alias_tracker @eager_loading = eager_loading tree = self.class.make_tree associations @join_root = JoinBase.new(base, table, build(tree, base)) |