joshuabowers / opium

An Object Parse.com Mapping technology for defining models.
MIT License
1 stars 0 forks source link

Reimplement Opium::Model::Scopable #6

Open joshuabowers opened 9 years ago

joshuabowers commented 9 years ago

Scopable is a bit of a tangled mess, at the moment, as I was attempting to figure it out without pulling too much influence from other ORM projects. Possibly a mistake.

While the current implementation mostly works, it notably lacks the ability to chain scopes: while a scope can be defined and invoked off of the model class, the scope is not available from within the Queryable chain. This would likely be easy enough to change, by providing a scope stack which could be searched through.

Need to reevaluate exactly the limitations of the current system and revise the above plan of attack. And probably appropriate inspiration from Mongoid.