On Mar 20, 10:29 am, Nels Nelson <[email protected]> wrote: > Is there a way to disable the automatic database schema interrogation > and implicit dataset assignment when a model class is defined? I'd > prefer that a model class definition to do absolutely nothing until a > dataset has been explicitly assigned to it.
No. There is always a dataset assigned to a model class (well, almost always). In fact, it's recommended not to use set_dataset at all, but provide the dataset when creating the model class: class Foo < Sequel::Model(:table) # or Sequel::Model(DB[:table]) end If you don't provide the correct parameters when defining the class, and use set_dataset later, Sequel will basically be checking the database schema twice, the first time with incorrect information. The problem with not providing correct parameters when defining the class is that there is no guarantee correct parameters will be provided later, and it can be the cause of weird errors that are difficult to track down. Is there a reason you are not able to provide correct parameters when the model class is defined? 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.
