提交 6356d420 编写于 作者: A Aaron Patterson

parent_table is only used internally

上级 85fe5edc
......@@ -25,11 +25,8 @@ class JoinAssociation < JoinPart # :nodoc:
attr_reader :tables
delegate :options, :through_reflection, :source_reflection, :chain, :to => :reflection
delegate :table, :table_name, :to => :parent, :prefix => :parent
delegate :alias_tracker, :to => :join_dependency
alias :alias_suffix :parent_table_name
def initialize(reflection, join_dependency, parent = nil)
reflection.check_validity!
......@@ -47,6 +44,9 @@ def initialize(reflection, join_dependency, parent = nil)
@tables = construct_tables.reverse
end
def parent_table_name; parent.table_name; end
alias :alias_suffix :parent_table_name
def ==(other)
other.class == self.class &&
other.reflection == reflection &&
......@@ -68,7 +68,7 @@ def join_constraints
joins = []
tables = @tables.dup
foreign_table = parent_table
foreign_table = parent.table
foreign_klass = parent.base_klass
scope_chain_iter = reflection.scope_chain.reverse_each
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册