On May 17, 2011, at 12:44 AM, Xavier (DBIYF) wrote:
> 
> We pretty much use the following two functions which allow some degree of 
> maintainability.
> 
> https://gist.github.com/976112

Wowza, that's cool. 

I don't understand why you need custom SQL generation in there, though, because 
I thought that this:

    collection = Admin.all(:role => :super_admin)
    DataMapper.repository.adapter.send(:select_statement, collection.query)

would work with any collection, thus supporting arbitrarily-complex queries 
that traverse associations, etc.

Are there some places that approach has fallen short for you?

> I need to write up a proper blog post for it.


Thank you for sharing, indeed! And please do write up a blog post, I think it 
would be of general interest.


Thanks,
Emmanuel

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to datamapper@googlegroups.com.
To unsubscribe from this group, send email to 
datamapper+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to