-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
Mongoid will never log a message if somebody overwrites an already defined scope.
In file:
https://github.com/mongoid/mongoid/blob/master/lib/mongoid/named_scope.rb#L129
if !scopes[name] && respond_to?(name, true)
has to be changed to
if scopes[name] && respond_to?(name, true)
Also would have an option which allows throwing an exception instead of silent logging (more helpful while development imho), maybe something like safe_scoping: true|false (default: false).