model_driven_api 3.2.2 → 3.2.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 010f1acfbe42371a8465ba5eeae1f6a5cc0d8c7d5891c30b52ed2c9056bfd7d0
|
4
|
+
data.tar.gz: fb81afbec2d0ce91297c68b212a97e213c0b0d7cf15630c82af753f5511ec1f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '01941ccd88639849a80e1068266b083911915793f0513835e6caf2c61b718d7c4c80d0c57c4a59f25f4a64ddf85a728d18fccada0cf7e53e813b39293b26b339'
|
7
|
+
data.tar.gz: e9243797670a8dba2dbd87a2e79571dbb5e39dea8fa26379934a08fe74137db7bb053fc73bbb63d811962397bff5e4cb64c11fdf7b65b5abcfe363827a7185df
|
@@ -53,7 +53,7 @@ class Api::V2::ApplicationController < ActionController::API
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def show
|
56
|
-
authorize! :show, @record_id
|
56
|
+
authorize! :show, @record_id.presence || @model
|
57
57
|
|
58
58
|
# Custom Show Action
|
59
59
|
status, result, status_number = check_for_custom_action
|
@@ -66,7 +66,8 @@ class Api::V2::ApplicationController < ActionController::API
|
|
66
66
|
|
67
67
|
def create
|
68
68
|
# Normal Create Action
|
69
|
-
|
69
|
+
Rails.logger.debug("Creating a new record #{@record}")
|
70
|
+
authorize! :create, @record.presence || @model
|
70
71
|
# Custom Action
|
71
72
|
status, result, status_number = check_for_custom_action
|
72
73
|
return render json: result, status: (status_number.presence || 200) if status == true
|
@@ -79,7 +80,7 @@ class Api::V2::ApplicationController < ActionController::API
|
|
79
80
|
end
|
80
81
|
|
81
82
|
def update
|
82
|
-
authorize! :update, @record
|
83
|
+
authorize! :update, @record.presence || @model
|
83
84
|
|
84
85
|
# Custom Action
|
85
86
|
status, result, status_number = check_for_custom_action
|
@@ -102,7 +103,7 @@ class Api::V2::ApplicationController < ActionController::API
|
|
102
103
|
end
|
103
104
|
|
104
105
|
def destroy
|
105
|
-
authorize! :destroy, @record
|
106
|
+
authorize! :destroy, @record.presence || @model
|
106
107
|
|
107
108
|
# Custom Action
|
108
109
|
status, result, status_number = check_for_custom_action
|
@@ -46,7 +46,10 @@ class Api::V2::InfoController < Api::V2::ApplicationController
|
|
46
46
|
pivot[model][:associations] ||= {
|
47
47
|
has_many: d.reflect_on_all_associations(:has_many).map { |a|
|
48
48
|
a.name if (((a.options[:class_name].presence || a.name).to_s.classify.constantize.new.is_a? ApplicationRecord) rescue false)
|
49
|
-
}.compact,
|
49
|
+
}.compact,
|
50
|
+
has_one: d.reflect_on_all_associations(:has_one).map { |a|
|
51
|
+
a.name if (((a.options[:class_name].presence || a.name).to_s.classify.constantize.new.is_a? ApplicationRecord) rescue false)
|
52
|
+
}.compact,
|
50
53
|
belongs_to: d.reflect_on_all_associations(:belongs_to).map { |a|
|
51
54
|
a.name if (((a.options[:class_name].presence || a.name).to_s.classify.constantize.new.is_a? ApplicationRecord) rescue false)
|
52
55
|
}.compact
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: model_driven_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore_backend_commons
|
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
- !ruby/object:Gem::Version
|
168
168
|
version: '0'
|
169
169
|
requirements: []
|
170
|
-
rubygems_version: 3.5.
|
170
|
+
rubygems_version: 3.5.11
|
171
171
|
signing_key:
|
172
172
|
specification_version: 4
|
173
173
|
summary: Convention based RoR engine which uses DB schema introspection to create
|