PerfectMemory/mongoid-multitenancy — pull request #13 by pranav-g10 (2014-06-27 08:48:47+00:00)
Title: Multi scoped searching

Consider adding an `Agent` model to the readme's example of `Client` and `Article`:

```ruby
class Agent
include Mongoid::Document

has_and_belongs_to_many clients, :inverse_of => nil

field :name, :type => String
end
```

Where an agent manages multiple clients, and might want to see all the articles of all it's clients. This can't be achieved using the present `current_tenant=` workflow.

I propose a new method `set_tenants` which can be used to set the current_tenant (needed for all the creation/validation purposes), as well as a list of scoping_tenants (which will be used by the default_scope for all the searches/deletes etc.) in a single call.