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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 190f87343976c6c393f9b2c80163ddc403b2575fd2c8fcceb125ef1996e7532a
4
- data.tar.gz: e393facfcd2b11ac2af44df2f5602074e2da1ee48974dbb2fdec6d4f346c837e
3
+ metadata.gz: f318cd8434ed86ff9045ec0a2849774d2d4232f9b057ea70c2313f2255011ff6
4
+ data.tar.gz: b587c4fee867ea15389db03d191c899061856fc8a53beea17bf7b88f0aa86cf3
5
5
  SHA512:
6
- metadata.gz: b4f9083c41e709a64d99278f84594d28ac94175983678c01b2b08124facf2ccf3264808034a1c30eac3d2801a763807ffc480bbc4ab17afe929216b3ce096ece
7
- data.tar.gz: 25e8013e5421b51b5fdce2d444fabdb5f66bc9e4805df7c2761646b43a0058dabf70ed7e11d2e36494740c0d5966ea300a4351a4f16754837caf0f23826a7b7e
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
- return true, MultiJson.dump(@model.send(resource, params))
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 || @model.json_attrs.presence || @json_attrs.presence || {} rescue {}
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.10
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-03-26 00:00:00.000000000 Z
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