thecore_api 1.3.11 → 1.3.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/api/v1/info_controller.rb +15 -0
- data/config/routes.rb +1 -0
- data/lib/thecore_api/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79fb4e15ac8df66a9d76781fd2ea1bf1caab704fbb850590821b9e778cce48a7
|
4
|
+
data.tar.gz: 7e9dc9a5868b70441c88507b868f6422edf85c1ed806759ad6546a5f2f1ad0b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b2be7f637c87e33faaebe77ab7d5285178eef003cccb1edfc4494761910e7fa3cc100c1b25eac1a00eb4e64fcf16d00d89c67802b15e12cf3ef497873f19059
|
7
|
+
data.tar.gz: 7401263aaf0c8a65f97255b4b80de22850664e27193bd609394c758b766c49136e610ee35eaa0fadfca0741b9ef9fe39fa7f5ea06723fc78975d5f624bd78e97
|
@@ -31,6 +31,21 @@ class Api::V1::InfoController < Api::V1::BaseController
|
|
31
31
|
render json: I18n.t(".", locale: (params[:locale].presence || :it)).to_json, status: 200
|
32
32
|
end
|
33
33
|
|
34
|
+
def schema
|
35
|
+
pivot = {}
|
36
|
+
if Rails.env.development?
|
37
|
+
Rails.configuration.eager_load_namespaces.each(&:eager_load!) if Rails.version.to_i = 5 #Rails 5
|
38
|
+
Zeitwerk::Loader.eager_load_all if Rails.version.to_i >= 6 #Rails 6
|
39
|
+
end
|
40
|
+
ApplicationRecord.subclasses.each do |d|
|
41
|
+
pivot[d.name.parameterize.tableize] ||= {}
|
42
|
+
d.columns_hash.each_pair do |key, val|
|
43
|
+
pivot[d.name.parameterize.tableize][key] = val.type
|
44
|
+
end
|
45
|
+
end
|
46
|
+
render json: pivot.to_json, status: 200
|
47
|
+
end
|
48
|
+
|
34
49
|
# private
|
35
50
|
|
36
51
|
# Method overridden because the first time I have to ask for the token
|
data/config/routes.rb
CHANGED
data/lib/thecore_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thecore_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore
|
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '0'
|
161
161
|
requirements: []
|
162
|
-
rubygems_version: 3.0.
|
162
|
+
rubygems_version: 3.0.6
|
163
163
|
signing_key:
|
164
164
|
specification_version: 4
|
165
165
|
summary: Taris API.
|