You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the list plugin in a config.sequel.after_connect proc results in Sequel::Error: No dataset associated with Sequel::Model as the plugin itself calls model.dataset when prepending the order.
The problem is that SequelRails.setup (I believe) hasn't set the dataset on Sequel::Model (or its subclasses).
The workaround is to do plugin :list in the actual Sequel::Model subclass. (Which seems more proper anyway, but a note somewhere could save some headaches.)
The text was updated successfully, but these errors were encountered:
Hello @contentfree, thanks for reporting this issue!
I think your problem is not related to when sequel-rails calls the after_connect hook, but about this specific plugin. It's not meant to be used globally, but only on a specific subclass of Sequel::Model which means the backing table already exist. Hence the error message Sequel::Error: No dataset associated with Sequel::Model which state that no dataset (and not database) is associated to Sequel::Model.
I can add a note about each plugin in Sequel being special and that user should be careful what plugin requirement is before trying to add them globally to all Sequel::Model subclasses. What do you think?
Using the
list
plugin in aconfig.sequel.after_connect
proc results inSequel::Error: No dataset associated with Sequel::Model
as the plugin itself callsmodel.dataset
when prepending the order.The problem is that
SequelRails.setup
(I believe) hasn't set the dataset onSequel::Model
(or its subclasses).The workaround is to do
plugin :list
in the actualSequel::Model
subclass. (Which seems more proper anyway, but a note somewhere could save some headaches.)The text was updated successfully, but these errors were encountered: