summaryrefslogtreecommitdiff
path: root/app/controllers/concerns/hooks_execution.rb
blob: 846cd60518f16dd075da864a4dcf9539ba6b5dca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module HooksExecution
  extend ActiveSupport::Concern

  private

  def set_hook_execution_notice(status, message)
    if status && status >= 200 && status < 400
      flash[:notice] = "Hook executed successfully: HTTP #{status}"
    elsif status
      flash[:alert] = "Hook executed successfully but returned HTTP #{status} #{message}"
    else
      flash[:alert] = "Hook execution failed: #{message}"
    end
  end
end