Add bulk repositioning API and document deferred unique constraints#55
Open
ollym wants to merge 7 commits intobrendon:mainfrom
Open
Add bulk repositioning API and document deferred unique constraints#55ollym wants to merge 7 commits intobrendon:mainfrom
ollym wants to merge 7 commits intobrendon:mainfrom
Conversation
Author
|
I've just added partial repositioning which again we needed in our implementation, so like: # positions: A:1, B:2, C:3, D:4, E:5
Item.update_position_in_order_of!([d.id, b.id])
# positions: A:1, D:2, C:3, B:4, E:5 |
Owner
|
Hi @ollym, thanks for this. Just letting you know I’m away on holiday at the moment but will look at this when I return :) Hope that’s ok? :) |
Author
|
@brendon tests pass for me locally, so unclear why it's not working on CI |
Owner
|
Looks like something to do with composite primary keys? Will have a closer look when I get back :) |
Update other dependencies at the same time.
Owner
|
Got the tests running. Might look at cherrypicking those commits into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for the gem. We wanted to introduce repositioning code that allows for bulk changes to the position that would also take care of position conflicts during the bulk reordering.
update_<column>_in_order_of!for bulk reordering by id list or weight hashMade sense to make it part of the "Healer" as they perform similar functionality.