Class: RailsInformant::Api::StatusController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/rails_informant/api/status_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/rails_informant/api/status_controller.rb', line 4

def show
  counts = ErrorGroup.group(:status).count
  render json: {
    duplicate_count: counts.fetch("duplicate", 0),
    fix_pending_count: counts.fetch("fix_pending", 0),
    ignored_count: counts.fetch("ignored", 0),
    resolved_count: counts.fetch("resolved", 0),
    unresolved_count: counts.fetch("unresolved", 0),
    deploy_sha: RailsInformant.current_git_sha,
    top_errors: top_errors
  }
end