Closed TheSmartnik closed 9 years ago
Haha! I think about it today too=) But it's not about only order. In scope we can do any strange things
scope :active, -> { where(active: true) }
or
scope :strange_scope, { Thing.where(id: 42) }
It's all about mapping
Oh, right. To support any scopes would be even better. Although, I'm afraid it may lead to some unexpected behavior in case of strange_scope
This already works!!! :smile: You simply have to name your collection after the scope.
class AlbumTwin < Disposable::Twin
collection :by_duration { .. }
Twins are not ORM mappers, they are data mappers that simply wrap arbitrary objects and collections into predictable in-memory objects.
Also, this is a duplicate with https://github.com/apotonick/disposable/issues/22.
Hi Nick, I wonder whether it is possible or not to somehow order collection. Something like:
Well, I mean, I know that it is not in current API right now, but maybe I could somehow implement desired behavior?