Class: RailsHealthChecks::GroupsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/rails_health_checks/groups_controller.rb

Instance Method Summary collapse

Methods included from Authentication

#authenticate!

Instance Method Details

#showObject



5
6
7
8
9
10
11
12
# File 'app/controllers/rails_health_checks/groups_controller.rb', line 5

def show
  group_name = params[:id].to_sym
  check_names = RailsHealthChecks.configuration.groups[group_name]
  return render json: { error: "Group '#{group_name}' not found" }, status: :not_found unless check_names

  builder = ResponseBuilder.new(run_checks(check_names))
  render json: builder.to_json, status: builder.http_status
end