On Sunday, September 17, 2017 at 11:30:28 PM UTC-7, Junaid Farooq wrote: > > We have been using version 4.49.0, and it was working very well. with this > code > > > CameraActivity.db = Sequel.connect(ENV['SNAPSHOT_DATABASE_URL'], > max_connections: 100) > > > But after update to new version I am getting an error as > > Cannot use Sequel::Model.db= on model with existing dataset. Use > Sequel::Model.dataset= instead. > > > my model looks like > > > > require 'active_support/core_ext/object/blank' > class CameraActivity < Sequel::Model > > end > > Can anyone please point what I am doing wrong here? > > You want to do:
CameraActivity.dataset = Sequel.connect(ENV['SNAPSHOT_DATABASE_URL'], max_connections: 100)[:camera_activities] As the error message states, you can't use Model.db= on a model with an existing dataset, as it is possible to end up with something that doesn't work correctly. 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 https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
