
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
A simple way to define next and previous relationships in an ActiveRecord model.
For example, if you have a list of articles
, and you want to be able to traverse them with article.next
and article.previous
.
Add to your Gemfile and run the bundle
command to install it.
gem "scoped_traversal"
Requires Ruby 1.9.2 or later.
In your model, call rank_by and pass in a column name.
class User < ActiveRecord::Base
traverse_by :score
end
You can then traverse them with the following methods:
@user.next
@user.previous
You can also add an optional namespace, like so:
class User < ActiveRecord::Base
traverse_by :score, :namespace => true
traverse_by :created_at, :namespace => :oldest
end
You can then traverse them with the following methods:
@user.next_score
@user.previous_score
@user.next_oldest
@user.previous_oldest
Questions or problems? Please post them on the issue tracker. You can contribute changes by forking the project and submitting a pull request. You can ensure the tests passing by running bundle
and rake
.
This gem is created by Wil Gieseler and is under the MIT License.
FAQs
Unknown package
We found that scoped_traversal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.