Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

remove scope_chain delegate

  • Loading branch information...
commit 279212d8b12e03a17fd45a33c74f37f8ac844650 1 parent 8ce72d9
@tenderlove tenderlove authored
View
6 activerecord/lib/active_record/associations/association_scope.rb
@@ -4,7 +4,7 @@ class AssociationScope #:nodoc:
attr_reader :association, :alias_tracker
delegate :klass, :reflection, :to => :association
- delegate :chain, :scope_chain, :to => :reflection
+ delegate :chain, :to => :reflection
def initialize(association)
@association = association
@@ -16,7 +16,7 @@ def scope
scope.extending! Array(reflection.options[:extend])
owner = association.owner
- add_constraints(scope, owner)
+ add_constraints(scope, owner, reflection.scope_chain)
end
def join_type
@@ -61,7 +61,7 @@ def bind(scope, table_name, column_name, value)
bind_value scope, column, value
end
- def add_constraints(scope, owner)
+ def add_constraints(scope, owner, scope_chain)
tables = construct_tables
chain.each_with_index do |reflection, i|
Please sign in to comment.
Something went wrong with that request. Please try again.