Skip to content

Commit

Permalink
Notifiy honeybadger when someone passes the deprecated initiate_workf…
Browse files Browse the repository at this point in the history
…low parameter
  • Loading branch information
jcoyne committed May 21, 2019
1 parent f3d1c01 commit 253c9bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/registration_request.rb
Expand Up @@ -16,7 +16,7 @@ class RegistrationRequest
# @option params [String] :pid Fully qualified PID if you don't want one generated for you
# @option params [Integer] :workflow_priority]
# @option params [Array<String>] :seed_datastream datastream_names (only 'descMetadata' is a permitted value)
# @option params [Array<String>] :initiate_workflow workflow_ids
# @option params [Array<String>] :initiate_workflow workflow_ids this parameter is deprecated
# @option params [Array] :tags
def initialize(params)
@params = params
Expand Down
2 changes: 2 additions & 0 deletions app/services/registration_service.rb
Expand Up @@ -134,6 +134,8 @@ def ids_to_hash(ids)
end

def initiate_workflow(workflows:, item:, priority:)
Honeybadger.notify("RegistrationService received deprecated parameter `initiate_workflow' with: `#{workflows.inspect}'") if workflows.present?

workflows.each do |workflow_id|
Dor::Config.workflow.client.create_workflow_by_name(item.pid, workflow_id, priority: priority)
end
Expand Down

0 comments on commit 253c9bf

Please sign in to comment.