model_driven_api 3.11.1 → 3.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f10db84ebc3b2fbb5b3461fcaa14c879096999fcdef4c90353172ac8313af7eb
|
|
4
|
+
data.tar.gz: ca43a58797580f249f6b48c80f3be07b607731a6a1973d04dc6d9af64adc654c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 39ca452f1c60589d6406de607425ce798a84882a366aa42ad648a8dc6b16e05e9535d6db18a8ea578b623ba6fcf1ec2a9c241a667369dd0fc03f505acad1a96f
|
|
7
|
+
data.tar.gz: 1c2dfe78a0c08f66eaf09bc6550213a988c42295549f0e7ffb23a66d13bea8a134ce52fb06dc60e65e67cca91f3dbe818929ffd5743bbc2cb460318e2551b982
|
|
@@ -6,7 +6,7 @@ class Api::V2::InfoController < Api::V2::ApplicationController
|
|
|
6
6
|
|
|
7
7
|
# api :GET, '/api/v2/info/version', "Just prints the APPVERSION."
|
|
8
8
|
def version
|
|
9
|
-
render json: { version:
|
|
9
|
+
render json: { version: ModelDrivenApi.app_version }.to_json, status: 200
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
# api :GET, '/api/v2/info/roles'
|
|
@@ -9,7 +9,6 @@ module ApiExceptionManagement
|
|
|
9
9
|
# AccessDenied (wrong login credentials), RecordNotFound, RecordInvalid, CanCan
|
|
10
10
|
# denial... answered 500. Covered by spec/lib/concerns/api_exception_management_spec.rb.
|
|
11
11
|
rescue_from StandardError, with: :fivehundred!
|
|
12
|
-
rescue_from NoMethodError, with: :not_found!
|
|
13
12
|
rescue_from CanCan::AccessDenied, with: :unauthorized!
|
|
14
13
|
rescue_from AuthenticateUser::AccessDenied, with: :unauthenticated!
|
|
15
14
|
rescue_from ActionController::RoutingError, with: :not_found!
|
data/lib/model_driven_api.rb
CHANGED
|
@@ -28,6 +28,14 @@ require "api/v3/serializer_factory"
|
|
|
28
28
|
module ModelDrivenApi
|
|
29
29
|
UTC_ZONE_NAMES = %w[UTC Etc/UTC].freeze
|
|
30
30
|
|
|
31
|
+
# The host app's deployed version: the `version` file in its root (Thecore release convention —
|
|
32
|
+
# CI builds and deploys when it changes; the image is `ADD . /app`, so it ships in Rails.root).
|
|
33
|
+
# nil when the app has no such file. Served by GET /api/v2|v3/info/version.
|
|
34
|
+
def self.app_version
|
|
35
|
+
file = Rails.root.join("version")
|
|
36
|
+
file.file? ? file.read.strip.presence : nil
|
|
37
|
+
end
|
|
38
|
+
|
|
31
39
|
# Raises unless the app is UTC-only: +time_zone+ is config.time_zone, +db_zone+ is
|
|
32
40
|
# config.active_record.default_timezone (nil = Rails' default, :utc). Called at boot by
|
|
33
41
|
# ModelDrivenApi::Engine's :enforce_utc_time_zone initializer.
|