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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bd3d266dca0cc6b50e37c4b87e3201f6b0d77832df40db10a214f84cc8b3143
4
- data.tar.gz: bc4b775d2197827c57142d71a7a5f46ccc35d8fbf7e36e95e4a4e4be84d4dc85
3
+ metadata.gz: 79fb4e15ac8df66a9d76781fd2ea1bf1caab704fbb850590821b9e778cce48a7
4
+ data.tar.gz: 7e9dc9a5868b70441c88507b868f6422edf85c1ed806759ad6546a5f2f1ad0b8
5
5
  SHA512:
6
- metadata.gz: addb715890b80b2cca5bc305f3e8255f66f7a8fa541b8cc2fc674a6fc4d21b2f812b985d30babf334ada3c988ae87a1b97c6628133440912bd4a8581d955a8ba
7
- data.tar.gz: b6befad608ce40f4a56f282988f0bbe0b7a5a7c1f74790589fb332b3642331e24a6ae1133340e4d33e0e9e51e20fce4ca90543a174262fef889e8ecac0adf76f
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
@@ -13,6 +13,7 @@ Rails.application.routes.draw do
13
13
  get :token
14
14
  get :available_roles
15
15
  get :translations
16
+ get :schema
16
17
  end
17
18
 
18
19
  resources :users, only: [:index, :create, :show, :update, :destroy] do
@@ -1,3 +1,3 @@
1
1
  module ThecoreApi
2
- VERSION = "1.3.11".freeze
2
+ VERSION = "1.3.12".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.3.11
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-07-02 00:00:00.000000000 Z
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.1
162
+ rubygems_version: 3.0.6
163
163
  signing_key:
164
164
  specification_version: 4
165
165
  summary: Taris API.