On Oct 28, 3:24 pm, Jeremy Evans <[email protected]> wrote: > On Oct 28, 3:00 pm, Gary Doades <[email protected]> wrote: > > > Is there a way to get what the current shard is for an instance of a > > model? In some of my models I have methods that need to query other > > (unrelated) tables, mostly configuration information. That information > > needs to come from the same shard as the current instance. I can't see > > a way of knowing what the current instance's shard is. Us usual, I've > > probably missed something obvious ;) > > It is a dataset option, so: > > model_instance.this.opts[:server] > > It's not that obvious, don't feel bad. :)
Ah, you're right. It's not that obvious... I guess I was hoping for a model_instance.current_server method or something. This will do the job just fine though. Thanks again, Gary. -- 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.
