Permalink
Browse files

remove scope_chain delegate

  • Loading branch information...
1 parent 8ce72d9 commit 279212d8b12e03a17fd45a33c74f37f8ac844650 @tenderlove tenderlove committed Feb 13, 2014
Showing with 3 additions and 3 deletions.
  1. +3 −3 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|

0 comments on commit 279212d

Please sign in to comment.