thecore_api 1.3.7 → 1.3.8

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: ee66014623dc5c8dc795ff7599ca71904b793647974a9bf203a01914a59ccac4
4
- data.tar.gz: c919762df62045495d03c6f25dd5b08ce04ff0e061a2c79055e19cda426b17e8
3
+ metadata.gz: 619b07b5b7dc5350433696280e6ef41c2d958db2ec15e9de1b7ed5524a1da0ad
4
+ data.tar.gz: 5f4a09a94de772c71d71bef1abe8c89d1102c6c0b59e3d201b61fa559d7556d0
5
5
  SHA512:
6
- metadata.gz: 64eb416b1b1d3f6c1cbcd59956ffcbe1d506c6ef46b8536ad33afea9b1ab4a897a5a9b8ff54f20d4121aad7a11497355e37b733ec6390c7ba20f478e74151f93
7
- data.tar.gz: 821d7f5e3c50ab1789f5da0823cad904b022222f66b00b4b40209d1310e19dc03711cbea810382dd5dd70f241e2b3a2c6e632003e9602c37ce557b394070ddbd
6
+ metadata.gz: c50e21fee8faba7b2192db8f8cd604c100bb86a1bfd6be0cdb2eb18664a6e4c1fd5f85116e626743a515bbb05d083a7e90c8414728b032d3fada5a4e1edb0533
7
+ data.tar.gz: 3b2dfc5b563791c97be3c6613418bc26f192ecc5e71166d4f46685f4416f6c327e93b25f4886c3d3cc45d1c3cd6221ae484b49b24143142da01149ad38d00647
@@ -104,12 +104,14 @@ class Api::V1::BaseController < ActionController::API
104
104
  pages_count: @records.total_pages,
105
105
  current_page_number: @records.current_page
106
106
  }) if !pages_info.blank?
107
- # If it's asked for page number, the paginate
108
- return render json: MultiJson.dump(@records, json_attrs) if !page.blank? # (@json_attrs || {})
107
+
108
+ status = @records_all.blank? ? 404 : 200
109
+ # If it's asked for page number, then paginate
110
+ return render json: MultiJson.dump(@records, json_attrs), status: status if !page.blank? # (@json_attrs || {})
109
111
  # if you ask for count, then return a json object with just the number of objects
110
112
  return render json: MultiJson.dump({count: @records_all.count}) if !count.blank?
111
113
  # Default
112
- render json: MultiJson.dump(@records_all, json_attrs) #(@json_attrs || {})
114
+ render json: MultiJson.dump(@records_all, json_attrs), status: status #(@json_attrs || {})
113
115
  end
114
116
 
115
117
  # def count
@@ -1,3 +1,3 @@
1
1
  module ThecoreApi
2
- VERSION = "1.3.7".freeze
2
+ VERSION = "1.3.8".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni