model_driven_api 3.5.5 → 3.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61a965405c27cbeed7e06d994c4cd97cd69ec81ba21e9eb1cd1f6feef3b32741
4
- data.tar.gz: 414b957e13b3ccff5a2a3b999242ad3ae3a310f5c635f2edeab21264a2633cf2
3
+ metadata.gz: 394acca44589bd5e704f0cbf966eab8eded237d1aafdcbc0f2a14318b78ceadc
4
+ data.tar.gz: 302dfcc51da16d380148f5fc1953065a0cf537657bb713bc705dab5184a8a4d2
5
5
  SHA512:
6
- metadata.gz: 269993f8be409f5f3fdea9509df7037cdbf6927d21efb28152c0a65e8e6c10dc549ed784490c39d0b758caa3140052e89499675aa3f55e391982d5887c5f97ad
7
- data.tar.gz: d05fef4b0562fc228a3c5ff12ecb82f7a283fd5a5cbefe16a5482f8783fb9d03edac64689452f5b53c253b0432b02febcc233bf777faab4445fafae06863c1ee
6
+ metadata.gz: 7da1bbd9f1f565296c34479faefba15d9ba77036cea33904740e2c74c646b7aef9c90681e8fdcec8b254efea20818c0719188271f135d58dccac4064100e0c90
7
+ data.tar.gz: 10702aeed1e9c0c925faa0214c01f0e2ed12187c09a23b559e5f9b1af89ce25cbe268883508bd7c9f75911aba49a2177190177eceb24c6e1947331420f0985dd
@@ -40,7 +40,7 @@ class Api::V2::ApplicationController < ActionController::API
40
40
  response.set_header("Content-Range", "#{@model.table_name} #{range_start}-#{range_end}/#{@records.total_count}")
41
41
 
42
42
  # puts "ALL RECORDS FOUND: #{@records_all.inspect}"
43
- status = @records_count.zero? ? 404 : 200
43
+ status = @records_count.zero? && params[:always_ok].blank? ? 404 : 200
44
44
  # puts "If it's asked for page number, then paginate"
45
45
  return render json: @records.as_json(json_attrs), status: status if !page.blank? # (@json_attrs || {})
46
46
  #puts "if you ask for count, then return a json object with just the number of objects"
@@ -140,18 +140,17 @@ class Api::V2::ApplicationController < ActionController::API
140
140
  # or
141
141
  # [GET|PUT|POST|DELETE] :controller/custom_action/:custom_action/:id
142
142
  def check_for_custom_action
143
-
144
143
  custom_action, token = if !params[:do].blank?
145
- # This also responds to custom actions which have the bearer token in the custom action name. A workaround to remove for some IoT devices
146
- # Which don't support token in header or in querystring
147
- # This is for backward compatibility and in future it can ben removed
148
- params[:do].split("-")
149
- elsif request.url.include? "/custom_action/"
150
- [params[:action_name], nil]
151
- else
152
- # Not a custom action call
153
- false
154
- end
144
+ # This also responds to custom actions which have the bearer token in the custom action name. A workaround to remove for some IoT devices
145
+ # Which don't support token in header or in querystring
146
+ # This is for backward compatibility and in future it can ben removed
147
+ params[:do].split("-")
148
+ elsif request.url.include? "/custom_action/"
149
+ [params[:action_name], nil]
150
+ else
151
+ # Not a custom action call
152
+ false
153
+ end
155
154
  return false unless custom_action
156
155
  # Poor man's solution to avoid the possibility to
157
156
  # call an unwanted method in the AR Model.
@@ -176,7 +175,7 @@ class Api::V2::ApplicationController < ActionController::API
176
175
  # Custom endpoint does not exist or cannot be called
177
176
  raise NoMethodError
178
177
  end
179
-
178
+
180
179
  return true, body.to_json(json_attrs), status
181
180
  end
182
181
 
@@ -1,3 +1,3 @@
1
1
  module ModelDrivenApi
2
- VERSION = "3.5.5".freeze
2
+ VERSION = "3.5.6".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_driven_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.5
4
+ version: 3.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni