app/controllers/blazer/checks_controller.rb in sql-jarvis-2.1.7 vs app/controllers/blazer/checks_controller.rb in sql-jarvis-2.1.8
- old
+ new
@@ -1,10 +1,9 @@
module Blazer
class ChecksController < BaseController
before_action :set_check, only: [:edit, :update, :destroy, :run]
before_action :set_new_check, only: [:new]
- before_action :set_accessible, only: [:new, :edit]
def index
state_order = [nil, "disabled", "error", "timed out", "failing", "passing"]
@checks = Blazer::Check.joins(:query).includes(:query).order("blazer_queries.name, blazer_checks.id").to_a.sort_by { |q| state_order.index(q.state) || 99 }
@checks.select! { |c| "#{c.query.name} #{c.emails}".downcase.include?(params[:q]) } if params[:q]
@@ -56,10 +55,11 @@
def set_new_check
@check = Blazer::Check.new(query_id: params[:query_id])
end
- def set_accessible
+ helper_method :slack_mentions
+ def slack_mentions
existed_members = @check&.slack_members.presence || []
@slack_mentions ||= get_slack_mentions + existed_members.each_with_object([]) { |m, list| list << [m, m] if m.present? }
ensure
@slack_mentions ||= []
end