diff options
| author | cedricnjanga | 2018-02-14 06:26:04 -0800 |
|---|---|---|
| committer | GitHub | 2018-02-14 06:26:04 -0800 |
| commit | 3916476c64dc690195a1273dab7188bb48f69152 (patch) | |
| tree | 4b0c02015b4e41ffb8bad34d3694266eae25ca20 /app/controllers | |
| parent | 2b37ca3b2f57d4c8cb00e18ce39371e7aefc1db3 (diff) | |
| parent | 385a9e1b68f3eea51f71386a8f4856477ba6a273 (diff) | |
| download | chouette-core-3562_ccset_affectation.tar.bz2 | |
Merge branch 'master' into 3562_ccset_affectation3562_ccset_affectation
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/statuses_controller.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/controllers/statuses_controller.rb b/app/controllers/statuses_controller.rb new file mode 100644 index 000000000..e38a92982 --- /dev/null +++ b/app/controllers/statuses_controller.rb @@ -0,0 +1,20 @@ +class StatusesController < ChouetteController + respond_to :json + + def index + + status = { + referentials_blocked: Referential.blocked.count, + imports_blocked: Import.blocked.count, + compliance_check_sets_blocked: ComplianceCheckSet.blocked.count + } + status[:status] = global_status status + render json: status.to_json + end + + private + + def global_status status + status.values.all?(&:zero?) ? 'ok' : 'ko' + end +end |
