On Thursday, September 26, 2013 12:06:59 AM UTC+2, Adam Gotterer wrote:

> Lets say we have a blog and comment model and are joining them together. 
> How can the Blog table be aliased in the query given a call 
> like: Blog.select_all(:blogs).join(Sequel.as(:comments, :c), blogs__id: 
> :c__blog_id). I tried Blog.as and Blog.dataset.as, the former failed and 
> the later returned and alias expression object that cant be used for 
> dataset operations.
>

It sounds like you want to modify the FROM clause, so you need to call 
Dataset#from:

  Blog.from(:blogs___b).select_all(:b).join(:comments___c, :blog_id=>:id)

If that's not what you are looking forward, it's best to post the SQL you 
want to generate.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to