mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
@previous_reflection.options[:source_type]
in PolymorphicReflection
is always true
Because `add_as_polymorphic_through` is only called when `options[:source_type]` is true.
This commit is contained in:
parent
4d7436f0aa
commit
f0811db807
1 changed files with 2 additions and 10 deletions
|
@ -1036,20 +1036,12 @@ module ActiveRecord
|
|||
|
||||
def scopes
|
||||
scopes = @previous_reflection.scopes
|
||||
if @previous_reflection.options[:source_type]
|
||||
scopes + [@previous_reflection.source_type_scope]
|
||||
else
|
||||
scopes
|
||||
end
|
||||
scopes << @previous_reflection.source_type_scope
|
||||
end
|
||||
|
||||
def join_scopes(table, predicate_builder) # :nodoc:
|
||||
scopes = @previous_reflection.join_scopes(table, predicate_builder) + super
|
||||
if @previous_reflection.options[:source_type]
|
||||
scopes + [@previous_reflection.source_type_scope]
|
||||
else
|
||||
scopes
|
||||
end
|
||||
scopes << @previous_reflection.source_type_scope
|
||||
end
|
||||
|
||||
def klass
|
||||
|
|
Loading…
Reference in a new issue