Kaminari::ActiveGraph
Adds ActiveGraph (Neo4j.rb) 11+ support to kaminari.
This gem is a port of
kaminari-neo4j updated for the
modern activegraph gem (the neo4j gem was renamed to activegraph starting
with 10.x, and the top-level constant moved from Neo4j to ActiveGraph).
Installation
Add this line to your application's Gemfile:
gem 'kaminari-activegraph'
And then execute:
$ bundle
Or install it yourself as:
$ gem install kaminari-activegraph
Usage
Once required, every ActiveGraph::Node model and QueryProxy chain gains the
standard kaminari #page / #per methods:
class User
include ActiveGraph::Node
property :name
end
User.page(2).per(20)
User.where(active: true).page(1).per(50)
The returned object is a Kaminari::ActiveGraph::Paginated collection that
exposes current_page, total_count, total_pages, limit_value,
offset_value, entry_name, etc., and is compatible with kaminari view
helpers such as paginate @users.
Compatibility
| Dependency | Version |
|---|---|
| activegraph | >= 11.0 |
| kaminari | >= 1.2.1 |
| activesupport | >= 6.0 |
| ruby | >= 2.7 |
For older neo4j (≤ 9.x) projects use the original
kaminari-neo4j gem instead.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Run the test suite (
bundle exec rspec) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
License
The gem is available as open source under the terms of the MIT License.