-
-
Notifications
You must be signed in to change notification settings - Fork 357
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
Make insert_at respect position when creating a new record #287
Comments
Hi @goalaleo, you can actually just pass the position you want into the new_dog = Dog.new(person: person, name: "Second Dog", position: 1) Acts As List will shuffle things around so that your new object has that position and the others don't. I hope that helps. I'll close this for now but let me know if you think I've missed the point. |
@brendon ok, thanks 👍 ! I still feel like the naming of |
I would expect an ArgumentError or something for new records rather than silently failing. |
Thanks @DanielHeath :) Would you be keen to put together a small PR for that? I'd be happy to merge that for you. |
Makes sense to me, will do. |
Upon closer inspection, there's clearly code intended to insert new records at the right position. I've fixed it so this case now works. |
Request
Currently the position of a new record uses the
add_new_at
value. Is it possible to make new records respect the parameter given toinsert_at
.Example:
The text was updated successfully, but these errors were encountered: