mongoid/mongoid — Issue #1373: Overwriting a scope will not be logged
Author: asaaki
Created: 2011-10-23 03:40:37+00:00
State: open

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

```ruby
if !scopes[name] && respond_to?(name, true)
```

has to be changed to

```ruby
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)`.