Yeah, I agree. Here's an example hacked together that fakes union/
intersection. But because it is using hashes, doesn't maintain the
correct order. Interesting none-the-less:

http://gist.github.com/222596

Tony (Thanatos)

On Oct 30, 2:03 pm, "Dan Kubb (dkubb)" <[email protected]> wrote:
> Thanatos,
>
> > Could we add a some form of Union/Intersect to a conditions hash? so
> > it could be User.all(Condition({:active => true}) | Condition
> > ({:confirmed => false}))?
>
> Yeah, that seems more verbose that what I'm planning, so I'd probably
> say no for now.
>
> I like the idea of encouraging people to build up queries using class
> methods too.  In AR when you used named scopes one of the better
> approaches I've seen is writing a named scope for each distinct state,
> and then chaining them together when building the queries. That's the
> sort of thing I'd like to encourage when using DM, except with the
> simpler class methods that return a Collection for each state.
>
> > Either way, I like it and I think it's a solid improvement!
>
> Glad you like it!
>
> --
>
> Dan
> (dkubb)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to