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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c0a58fe7f76f77865720c5cb5b9fff3bfcca8060fb793f63bdfbce3d3a9ef13
4
- data.tar.gz: e9460f642937700436d91b81dd1d66d15d45d9969e54584d341aa88262e57c0e
3
+ metadata.gz: 01ae48e93fb6f43a6fc2deefc7aaafdae32beb0d4ea2fa19dad013f700add7b6
4
+ data.tar.gz: 5c21136fbcbd4459e6541d1daa46fcf1745ef337c4d8f4adac3a548c82525678
5
5
  SHA512:
6
- metadata.gz: e2304475f581a222012b6b369f83aeea39023487159045312b6253bee5b4696f11fc72c25bf294564feb84590edbdd21c69e0f9d36c13f49a55461f8b3e5d0b6
7
- data.tar.gz: f1d772697e5d8de929d1c1186a0f21fa6e25afae9490045756345008731b63db901c3f480d5cbd426f92a6c288c3b995dbfb6b69a9bc496a54694b07466b7387
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
@@ -14,6 +14,7 @@ Rails.application.routes.draw do
14
14
  get :available_roles
15
15
  get :translations
16
16
  get :schema
17
+ get :dsl
17
18
  end
18
19
 
19
20
  resources :users, only: [:index, :create, :show, :update, :destroy] do
@@ -1,3 +1,3 @@
1
1
  module ThecoreApi
2
- VERSION = "1.5.7".freeze
2
+ VERSION = "1.5.9".freeze
3
3
  end
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.7
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-01-27 00:00:00.000000000 Z
11
+ date: 2020-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore