To make it work, you need to: - Enable the extension prior to defining the FooModel class - Run the paginate method on the model dataset with FooModel.dataset.paginate(1,2)
I'm not sure if there's a reason why the model doesn't proxy the paginate method to its underlying dataset. Best Em dom., 22 de ago. de 2021 às 17:47, Алексей Мацкевич < aleksei_mackev...@outlook.com> escreveu: > I use Sequel version 5.44 > ```ruby > # foo_model.rb > class FooModel < Sequel::Model > plugin :json_serializer > plugin :timestamps, update_on_create: true > > > *end# console*> Sequel.extension :pagination > [ > [0] :pagination > ] > > > FooModel.paginate(1,2) > NoMethodError: undefined method `paginate' for FooModel:Class > ``` > I was struggling with this for hours studying the documentation but was > not successful, what could I have done wrong? > > -- > 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 sequel-talk+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sequel-talk/bcb3ae77-8b20-4817-aa03-1162b6e6ed13n%40googlegroups.com > <https://groups.google.com/d/msgid/sequel-talk/bcb3ae77-8b20-4817-aa03-1162b6e6ed13n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 sequel-talk+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sequel-talk/CANtavQ5TV%3D0tSLFcB4WauS3ohg68qLKsKRZvu2Ct6tE_hYBH2A%40mail.gmail.com.