On Sunday, September 15, 2013 1:53:36 AM UTC-7, Rob Miller wrote:

> Thanks, that works perfectly!
>
> One thing, though: if I want to use where on my model to filter, I have 
> to use e.g. .where(:ed1__value => 'foo') rather than being able to use 
> .where(:first_name 
> => 'foo'). Obviously that's entirely logical — the SQL doesn't know that 
> first_name 
> == ed1.value — but is there any way to inform Sequel that that's the case?
>
You'd have to do identifier mangling, which is not something I recommend. 
 You could just add a .from_self to the model's dataset, which runs the 
dataset query in a subquery, which should allow that filter to work.

I'm guessing there's some sort of mapping internally (generated from the 
> select method?) because I do get the first_name, first_name=, last_name, 
> last_name= methods on instances of my model as I'd expect.
>
> Methods are created for the model's columns, but that's not a mapping of 
ed1.value to first_name.
 
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