On Monday, April 6, 2015 at 3:01:59 PM UTC-7, Tim Uckun wrote:
>
> I am opening up multiple database connections like this
>
> LocalDB=Sequel.connect(....)
> Remote1 = ....
> Remote2=...
>
> What's the best way to define models on these? All the examples I see are 
> in this form
>
> class User < Sequel::Model
>
> What I would like to do is to create a base class
>
> class Local::BaseModel
>    set_database LocalDB
> end
>
> class Local::User < Local::BaseModel
> end
>
> Is this possible?
>

If you want to use an abstract base class, you should do:

  Local::BaseModel = Sequel::Model(LocalDB)

Then things should work as expected.

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/d/optout.

Reply via email to