model_driven_api 2.3.10 → 2.3.11
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/v2/application_controller.rb +3 -2
- 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: f318cd8434ed86ff9045ec0a2849774d2d4232f9b057ea70c2313f2255011ff6
|
4
|
+
data.tar.gz: b587c4fee867ea15389db03d191c899061856fc8a53beea17bf7b88f0aa86cf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d92b432a32ee4a23c2209f66ab40eb6d2f56bb3fc9b7229da63eba8a105aacdfcfea36b21cb2739f879077e9f736e1b0ba3e5c4d0602b070cc388aaec684cefa
|
7
|
+
data.tar.gz: 330b5cbc65fed482fc7af84368967ae3987047d6235f68b5f8fa1b8757c626dbfcde0f6bdde13d3f644666850f24be6cd9a793ffe6ea528ed78b35d9dc8cb933
|
@@ -113,7 +113,8 @@ class Api::V2::ApplicationController < ActionController::API
|
|
113
113
|
resource = "custom_action_#{params[:do]}"
|
114
114
|
raise NoMethodError unless @model.respond_to?(resource)
|
115
115
|
# return true, MultiJson.dump(params[:id].blank? ? @model.send(resource, params) : @model.send(resource, params[:id].to_i, params))
|
116
|
-
|
116
|
+
puts json_attrs
|
117
|
+
return true, @model.send(resource, params).to_json(json_attrs)
|
117
118
|
end
|
118
119
|
# if it's here there is no custom action in the request querystring
|
119
120
|
return false
|
@@ -160,7 +161,7 @@ class Api::V2::ApplicationController < ActionController::API
|
|
160
161
|
# has precedence over if you have setup the json_attrs in the model concern
|
161
162
|
from_params = params[:a].deep_symbolize_keys unless params[:a].blank?
|
162
163
|
from_params = params[:json_attrs].deep_symbolize_keys unless params[:json_attrs].blank?
|
163
|
-
from_params.presence || @
|
164
|
+
from_params.presence || @json_attrs.presence || @model.json_attrs.presence || {} rescue {}
|
164
165
|
end
|
165
166
|
|
166
167
|
def extract_model
|
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: 2.3.
|
4
|
+
version: 2.3.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore_backend_commons
|