caprese 0.3.11 → 0.3.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/caprese/controller/concerns/query.rb +0 -1
- data/lib/caprese/errors.rb +11 -3
- data/lib/caprese/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0802a72a6fea0cdf81ac59f8642e41311eec6fe2
|
4
|
+
data.tar.gz: 095bf0cebda59ca5853e0bdf2376725a39220cbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ce5e1ffef8d695e65b69973be4a078364a29a8af8f801e087fd7287714c5ea89f01a7ac594a57923a4527fd84a6086af72f4b03e66cc1dd67fd9f7df83cf66b
|
7
|
+
data.tar.gz: d89cf6f8f61b18c9e483b4b776f26bc5d67f9decc06f7f334c62a5989519fb3d08d42a1a2f365aee7115c2eea3374039e57eb40350b744ad0c325ae188c2edb1
|
data/CHANGELOG.md
CHANGED
data/lib/caprese/errors.rb
CHANGED
@@ -24,10 +24,14 @@ module Caprese
|
|
24
24
|
# @param [String] model the name of the model we searched for a record of
|
25
25
|
# @param [Value] value the value we searched for a match with
|
26
26
|
class RecordNotFoundError < Error
|
27
|
-
def initialize(
|
28
|
-
super field:
|
27
|
+
def initialize(model: nil, value: nil)
|
28
|
+
super field: :id, code: :not_found, t: { model: model, value: value }
|
29
29
|
@header = { status: :not_found }
|
30
30
|
end
|
31
|
+
|
32
|
+
def full_message
|
33
|
+
I18n.t("#{i18n_scope}.parameters.not_found", t)
|
34
|
+
end
|
31
35
|
end
|
32
36
|
|
33
37
|
# Thrown when an association was not found when calling `record.association()`
|
@@ -35,9 +39,13 @@ module Caprese
|
|
35
39
|
# @param [String] name the name of the association
|
36
40
|
class AssociationNotFoundError < Error
|
37
41
|
def initialize(name)
|
38
|
-
super field: name, code: :
|
42
|
+
super field: :name, code: :not_found, t: { model: 'relationship', value: name }
|
39
43
|
@header = { status: :not_found }
|
40
44
|
end
|
45
|
+
|
46
|
+
def full_message
|
47
|
+
I18n.t("#{i18n_scope}.parameters.not_found", t)
|
48
|
+
end
|
41
49
|
end
|
42
50
|
|
43
51
|
# Thrown when an action that is forbidden was attempted
|
data/lib/caprese/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caprese
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Landgrebe
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-02-
|
13
|
+
date: 2017-02-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: active_model_serializers
|