aliases/implications: remove 'pending' state.
Remove the pending status from tag aliases and implications. Previously aliases would be created first in the pending state then changed to active when the alias was later processed in a delayed job. This meant that BURs weren't processed completely sequentially; first all the aliases in a BUR would be created in one go, then later they would be processed and set to active sequentially. This was problematic in complex BURs that tried to reverse or swap around aliases, since new pending aliases could be created before old conflicting aliases were removed.
This commit is contained in:
@@ -156,12 +156,14 @@ class BulkUpdateRequestsControllerTest < ActionDispatch::IntegrationTest
|
||||
create(:tag, name: "artist2a", category: Tag.categories.artist, post_count: 20)
|
||||
@bulk_update_request = create(:bulk_update_request, script: "mass update artist1a -> artist1b\ncreate alias artist2a -> artist2b")
|
||||
|
||||
post_auth approve_bulk_update_request_path(@bulk_update_request), @builder
|
||||
perform_enqueued_jobs do
|
||||
post_auth approve_bulk_update_request_path(@bulk_update_request), @builder
|
||||
end
|
||||
|
||||
assert_redirected_to(bulk_update_requests_path)
|
||||
assert_equal("approved", @bulk_update_request.reload.status)
|
||||
assert_equal(@builder, @bulk_update_request.approver)
|
||||
assert_equal(true, TagAlias.where(antecedent_name: "artist2a", consequent_name: "artist2b").exists?)
|
||||
assert_equal(true, TagAlias.exists?(antecedent_name: "artist2a", consequent_name: "artist2b", status: "active"))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user