Skip to content

Commit

Permalink
Don't merge reflection_scope if reflection.scope isn't given
Browse files Browse the repository at this point in the history
If `reflection.scope` isn't given, `reflection_scope` is always
`klass.unscoped`. it is unnecessary to merge it.
  • Loading branch information
kamipo committed Sep 4, 2017
1 parent 9551bad commit 2b5f5cd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def build_scope
scope.where!(reflection.type => model.base_class.sti_name)
end

scope.merge!(reflection_scope)
scope.merge!(reflection_scope) if reflection.scope
scope.merge!(preload_scope) if preload_scope
scope
end
Expand Down

0 comments on commit 2b5f5cd

Please sign in to comment.