Fix kaminari-activerecord relation type#939
Conversation
Previously, we needed to add our own handwritten type to AR model.
```rbs
class Talk < ApplicationRecord
class ActiveRecord_Relation
def page: (untyped) -> self
def per: (Integer) -> self
end
end
```
This is fixed by this commit.
|
@okuramasafumi Thanks for your contribution! Please follow the instructions below for each change. Available commandsYou can use the following commands by commenting on this PR.
|
|
I’m checking this because I think we might also need to update the tests. :loading: |
|
OK, so now I noticed that what is a problem. Talk.page(1).per(10)But this doesn't: Talk.all.page(1).per(10)I believe it's because |
|
https://github.com/kaminari/kaminari/blob/master/README.md#changing-page_method_name If we fix the name here, it may be useful for many applications that have not changed their settings, but it may cause confusion for some applications that have changed their settings. |
Right, but if it's not common, adding |
|
In RBS, we cannot redefine the same method name, nor can we invalidate existing definitions. |
Previously, we needed to add our own handwritten type to AR model.
This is fixed by this Pull Request.