BURs: refactor implication wiki page validations.
Move the validation that the tags in an implication must have wiki pages back into the TagImplication model. Use validation contexts to only run the validation when the BUR is created, not when the BUR is approved.
This commit is contained in:
@@ -73,6 +73,7 @@ class BulkUpdateRequest < ApplicationRecord
|
||||
def approve!(approver)
|
||||
transaction do
|
||||
CurrentUser.scoped(approver) do
|
||||
processor.validate!(:approval)
|
||||
processor.process!(approver)
|
||||
update!(status: "approved", approver: approver)
|
||||
forum_updater.update("The #{bulk_update_request_link} (forum ##{forum_post.id}) has been approved by @#{approver.name}.")
|
||||
@@ -107,7 +108,7 @@ class BulkUpdateRequest < ApplicationRecord
|
||||
end
|
||||
|
||||
def validate_script
|
||||
if processor.invalid?
|
||||
if processor.invalid?(:request)
|
||||
errors[:base] << processor.errors.full_messages.join("; ")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user