-
-
Notifications
You must be signed in to change notification settings - Fork 356
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
Using top_of_list
set to 1 and setting a record to index 0 triggers a PG::UniqueViolation
#322
Comments
Hi @TheNeikos :) We're keen to help improve things. Would you like to look at putting together a PR to add this exception along with a test? |
@brendon I've opened a PR, let me know if you want anything changed! |
Roger, will look at this tomorrow :D |
Ping 😁 |
Sorry about the delay :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've had quite a headache trying to use this gem, until I saw that
top_of_list
defaults to 1 and I try starting at 0.This in turn caused a
PG::UniqueViolation
due to the incorrect swapping of objects. I think this could be prevented by raising an exception when trying to set an index that is lower thantop_of_list
? (Which should be an error anyway imo)Once I changed that setting the Exception went away, so I assumed that to be the cause.
So my suggestion would be to raise an error when an incorrect position is given
The text was updated successfully, but these errors were encountered: