提交 279212d8 编写于 作者: A Aaron Patterson

remove scope_chain delegate

上级 8ce72d91
...@@ -4,7 +4,7 @@ class AssociationScope #:nodoc: ...@@ -4,7 +4,7 @@ class AssociationScope #:nodoc:
attr_reader :association, :alias_tracker attr_reader :association, :alias_tracker
delegate :klass, :reflection, :to => :association delegate :klass, :reflection, :to => :association
delegate :chain, :scope_chain, :to => :reflection delegate :chain, :to => :reflection
def initialize(association) def initialize(association)
@association = association @association = association
...@@ -16,7 +16,7 @@ def scope ...@@ -16,7 +16,7 @@ def scope
scope.extending! Array(reflection.options[:extend]) scope.extending! Array(reflection.options[:extend])
owner = association.owner owner = association.owner
add_constraints(scope, owner) add_constraints(scope, owner, reflection.scope_chain)
end end
def join_type def join_type
...@@ -61,7 +61,7 @@ def bind(scope, table_name, column_name, value) ...@@ -61,7 +61,7 @@ def bind(scope, table_name, column_name, value)
bind_value scope, column, value bind_value scope, column, value
end end
def add_constraints(scope, owner) def add_constraints(scope, owner, scope_chain)
tables = construct_tables tables = construct_tables
chain.each_with_index do |reflection, i| chain.each_with_index do |reflection, i|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册