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 августа 2021 г. в 10:13:52 UTC+3, Marcelo: 

> 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_...@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...@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/3b96a3e3-1d5d-4c25-8da6-90a2b1b63ac2n%40googlegroups.com.

Reply via email to