Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
以下のようなモデルを定義した場合に、
以下のように動作することを確認しています。
ヘルパーもひと通り動いているようです。
現時点で気になっているのが以下の点です。
Mongoid::Document
とMongoid::Criteria
の両方に対して似たような処理をしているItem.page(1)
の場合はDocument
が、Item.where(...).page(1)
のような場合はCriteria
が返るためKaminari::Mongoid::Criteria
に対してpage
以外のメソッドもフラットに定義しているCriteria
にはscopeが無いようなのでとりあえずこうしていますspec/fake_app.rb
にMongoid用のコードを入れるとrake spec
時にMongoDBが必要になってしまうので現状ノータッチですまだまだ課題が残る感じですが、とりあえず取り込んでいただければ追々進めていけるかなと思っていますので。よろしくお願いします。