It's a month later but... thanks! Works like a charm.

On Dec 16 2009, 11:50 am, Jeremy Evans <[email protected]> wrote:
> On Dec 16, 10:51 am, cult hero <[email protected]> wrote:
>
> > All right, I ran into a funny problem today on an MSSQL db (although
> > that point isn't terribly relevant). I've had to manually set the
> > primary key, although I came to find out the primary key is actually
> > compound.
>
> > I have a user_id and a company_id. However, the fact is, I will only
> > ever use ONE company_id ever. On an association I can pass do this:
>
> > :conditions => { :company_id => xxxx }
>
> > Is there a way to do something similar with set_dataset?
>
> class Blah < Sequel::Model(DB[:blahs].filter(:company_id=>xxxx))
> end
>
> > The workaround I have in place for now is: set_dataset dataset.order
> > (:company_id) because the only company_id that matters is the one that
> > has the numerically lowest value. However, what would like to be able
> > to specify the company_id specifically.
>
> Just like you can call set_dataset dataset.order, you can call
> set_dataset dataset.filter.
>
> Jeremy
-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" 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/sequel-talk?hl=en.


Reply via email to