thecore_api 1.5.0 → 1.5.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d63cdc47901fc71b695a011afaa3ef94efa86001bd384a834445585455578334
|
|
4
|
+
data.tar.gz: 4cd3683e479e3c1b18a556f403bd478ac9ff28851f51d0d4295c9ea8beb1fe80
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a6aa83945499df23c3bec088973b4b725e1807e2c7e8d439162f2d4c48208db5b3353d5942dba23310c7269a58cf207ed7bcce1ac59181a5617730a20eb2df04
|
|
7
|
+
data.tar.gz: 4df0635510e2a3777b700e65ac56e2f8a114da0cf1094192c684eda1dc18f451e42054d83b0e88bec5ac9a18681677dde5a4ef0b3f6b5c4a36666e44260c7e0b
|
|
@@ -31,9 +31,12 @@ class Api::V1::BaseController < ActionController::API
|
|
|
31
31
|
rescue_from ActiveRecord::RecordNotFound, with: :not_found!
|
|
32
32
|
rescue_from NameError, with: :not_found!
|
|
33
33
|
rescue_from NoMethodError, with: :not_found!
|
|
34
|
+
rescue_from RubySpark::Device::ApiError, with: :fivehundred!
|
|
34
35
|
|
|
35
36
|
attr_accessor :current_user
|
|
36
37
|
|
|
38
|
+
# JWT: https://www.pluralsight.com/guides/token-based-authentication-with-ruby-on-rails-5-api
|
|
39
|
+
|
|
37
40
|
#Disabling Strong Parameters
|
|
38
41
|
# def params
|
|
39
42
|
# request.parameters
|
|
@@ -204,6 +207,10 @@ class Api::V1::BaseController < ActionController::API
|
|
|
204
207
|
api_error status: 422, errors: exception.record.errors
|
|
205
208
|
end
|
|
206
209
|
|
|
210
|
+
def fivehundred!
|
|
211
|
+
api_error status: 500, errors: [I18n.t("api.errors.fivehundred", default: "Internal Server Error")]
|
|
212
|
+
end
|
|
213
|
+
|
|
207
214
|
def api_error(status: 500, errors: [])
|
|
208
215
|
# puts errors.full_messages if !Rails.env.production? && errors.respond_to?(:full_messages)
|
|
209
216
|
head status && return if errors.empty?
|
data/lib/thecore_api/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: thecore_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.5.
|
|
4
|
+
version: 1.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gabriele Tassoni
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-10-
|
|
11
|
+
date: 2019-10-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thecore
|