aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-02-13 15:42:32 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2014-02-14 11:15:54 -0800
commit279212d8b12e03a17fd45a33c74f37f8ac844650 (patch)
treea53e5ce03a7873a6644257eeaf1303d24b192f93 /activerecord
parent8ce72d91b68ef61ce7149ccac0c1be8923561ac2 (diff)
downloadrails-279212d8b12e03a17fd45a33c74f37f8ac844650.tar.gz
rails-279212d8b12e03a17fd45a33c74f37f8ac844650.tar.bz2
rails-279212d8b12e03a17fd45a33c74f37f8ac844650.zip
remove scope_chain delegate
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/associations/association_scope.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/association_scope.rb b/activerecord/lib/active_record/associations/association_scope.rb
index 15691e26df..f936bcb80e 100644
--- a/activerecord/lib/active_record/associations/association_scope.rb
+++ b/activerecord/lib/active_record/associations/association_scope.rb
@@ -4,7 +4,7 @@ module ActiveRecord
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 @@ module ActiveRecord
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 @@ module ActiveRecord
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|