Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

stop exposing table_joins

  • Loading branch information...
commit 494a26d798966a900127d3d4df6bada152896222 1 parent c24ea24
@tenderlove tenderlove authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 activerecord/lib/active_record/associations/alias_tracker.rb
View
7 activerecord/lib/active_record/associations/alias_tracker.rb
@@ -5,12 +5,11 @@ module Associations
# Keeps track of table aliases for ActiveRecord::Associations::ClassMethods::JoinDependency and
# ActiveRecord::Associations::ThroughAssociationScope
class AliasTracker # :nodoc:
- attr_reader :aliases, :table_joins, :connection
+ attr_reader :aliases, :connection
# table_joins is an array of arel joins which might conflict with the aliases we assign here
def initialize(connection, table_joins = [])
- @aliases = Hash.new { |h,k| h[k] = initial_count_for(k) }
- @table_joins = table_joins
+ @aliases = Hash.new { |h,k| h[k] = initial_count_for(k, table_joins) }
@connection = connection
end
@@ -46,7 +45,7 @@ def aliased_name_for(table_name, aliased_name)
private
- def initial_count_for(name)
+ def initial_count_for(name, table_joins)
return 0 if Arel::Table === table_joins
# quoted_name should be downcased as some database adapters (Oracle) return quoted name in uppercase
Please sign in to comment.
Something went wrong with that request. Please try again.