提交 b8b6621a 编写于 作者: P Pratik Naik

Simplify Model.scoped definition

上级 603d4fba
......@@ -26,13 +26,7 @@ def scoped(options = {}, &block)
if options.present?
Scope.new(self, options, &block)
else
current_scope = current_scoped_methods
unless current_scope
unscoped.spawn
else
construct_finder_arel({}, current_scoped_methods)
end
current_scoped_methods ? unscoped.merge(current_scoped_methods) : unscoped.spawn
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册