Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement advisory locks and some other methods #14

Merged
merged 11 commits into from
Aug 16, 2024
Merged

Conversation

richardboehme
Copy link
Owner

No description provided.

This implements optional (highly encouraged) advisory locking if the
model class responds to `with_advisory_lock`.

The easiest way to use this feature is to install the
`with_advisory_lock` gem (https://github.com/ClosureTree/with_advisory_lock).

Have a look at the README for all possible configuration options.
If the `move_to` (or `move_to!`) method is called with a position that
exceeds the collection's size, lexorank would have positioned the record
in the middle (using 'U' as the rank).

With this change calling it with such a position will position the
record at the end of the collection.
This makes the concern that is included into all models a lot smaller
and extracts all our internal state and methods into a separate class.
This also prevents unnecessary pollution of model classes that use
lexorank.
@richardboehme richardboehme merged commit 8936f77 into main Aug 16, 2024
19 checks passed
@richardboehme richardboehme deleted the advisory-locks branch August 16, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant