Adding chainable scopes and named scopes to MongoMapper

With Scopify chainable scopes and named scopes can be added to any model, for example MongoMapper:

MongoMapper::Document::ClassMethods.send(:include, Scopify::ClassMethods)
MongoMapper::Plugins::Associations::Proxy.send(:include, Scopify::ClassMethods)

It adds basic scoping and with some love from the Mongo community, it will soon be able to also merge multiple conditions / order`s.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s