mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
clean up add_constraints signature
This commit is contained in:
parent
a35325e324
commit
db3f50c767
1 changed files with 9 additions and 8 deletions
|
@ -9,15 +9,13 @@ module ActiveRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def scope
|
def scope
|
||||||
klass = association.klass
|
klass = association.klass
|
||||||
reflection = association.reflection
|
reflection = association.reflection
|
||||||
scope = klass.unscoped
|
scope = klass.unscoped
|
||||||
scope.extending! Array(reflection.options[:extend])
|
owner = association.owner
|
||||||
|
|
||||||
owner = association.owner
|
scope.extending! Array(reflection.options[:extend])
|
||||||
scope_chain = reflection.scope_chain
|
add_constraints(scope, owner, klass, reflection)
|
||||||
chain = reflection.chain
|
|
||||||
add_constraints(scope, owner, scope_chain, chain, klass, reflection)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def join_type
|
def join_type
|
||||||
|
@ -62,7 +60,10 @@ module ActiveRecord
|
||||||
bind_value scope, column, value
|
bind_value scope, column, value
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_constraints(scope, owner, scope_chain, chain, assoc_klass, refl)
|
def add_constraints(scope, owner, assoc_klass, refl)
|
||||||
|
chain = refl.chain
|
||||||
|
scope_chain = refl.scope_chain
|
||||||
|
|
||||||
tables = construct_tables(chain, assoc_klass, refl)
|
tables = construct_tables(chain, assoc_klass, refl)
|
||||||
|
|
||||||
chain.each_with_index do |reflection, i|
|
chain.each_with_index do |reflection, i|
|
||||||
|
|
Loading…
Reference in a new issue