thecore_api 1.5.7 → 1.5.9
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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01ae48e93fb6f43a6fc2deefc7aaafdae32beb0d4ea2fa19dad013f700add7b6
|
4
|
+
data.tar.gz: 5c21136fbcbd4459e6541d1daa46fcf1745ef337c4d8f4adac3a548c82525678
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef73d9226a218b7066cdbb624e552ed9984e2f7b5e1a4e08aa3365dc6c390169139d907b74ae635d5b819c47be0f7009bb2fdadbbda495274a643868433d0a84
|
7
|
+
data.tar.gz: cded6fcd74ee607cac31dfba0753eac7284bee716ada39c05af8b74b2f9e757459c29d63ce7b509cf65602f81b9b7149401ca8e4d111e1a46d54385ad8edde03
|
@@ -58,6 +58,21 @@ class Api::V1::InfoController < Api::V1::BaseController
|
|
58
58
|
render json: pivot.to_json, status: 200
|
59
59
|
end
|
60
60
|
|
61
|
+
# GET '/api/v1/info/dsl'
|
62
|
+
def dsl
|
63
|
+
pivot = {}
|
64
|
+
if Rails.env.development?
|
65
|
+
Rails.configuration.eager_load_namespaces.each(&:eager_load!) if Rails.version.to_i == 5 #Rails 5
|
66
|
+
Zeitwerk::Loader.eager_load_all if Rails.version.to_i >= 6 #Rails 6
|
67
|
+
end
|
68
|
+
ApplicationRecord.subclasses.each do |d|
|
69
|
+
model = d.to_s.underscore.tableize
|
70
|
+
pivot[model] ||= {}
|
71
|
+
|
72
|
+
pivot[model][:dsl] ||= (d.instance_methods(false).include?(:json_attrs) && !d.json_attrs.blank?) ? d.json_attrs : nil
|
73
|
+
end
|
74
|
+
render json: pivot.to_json, status: 200
|
75
|
+
end
|
61
76
|
# private
|
62
77
|
|
63
78
|
# 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.5.
|
4
|
+
version: 1.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore
|