Re: Pagination does not work on models

2021-08-23 Thread Алексей Мацкевич
Thanks понедельник, 23 августа 2021 г. в 17:31:28 UTC+3, Jeremy Evans: > On Mon, Aug 23, 2021 at 12:13 AM Marcelo Pereira > wrote: > >> 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 >>

Re: Pagination does not work on models

2021-08-23 Thread Jeremy Evans
On Mon, Aug 23, 2021 at 12:13 AM Marcelo Pereira < marcelovitor.pere...@gmail.com> wrote: > 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

Re: Pagination does not work on models

2021-08-23 Thread Алексей Мацкевич
I've tried loading the extension before defining models, it doesn't work. And I tried calling dataset on the model and pagination on it - that doesn't work either. The only thing that works is pagination directly on the db schema - ```ruby DB[:foo_models].paginate(1,2) ``` понедельник, 23

Re: Pagination does not work on models

2021-08-23 Thread Marcelo Pereira
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.,

Pagination does not work on models

2021-08-22 Thread Алексей Мацкевич
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