ocean-rails 1.21.0 → 1.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ocean/ocean_resource_controller.rb +6 -3
- data/lib/ocean/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0863495cb9e8b69a7d6c5bd8385bd1652f13d9a1
|
4
|
+
data.tar.gz: da30870c277cfb5ad6709dfb89a89bbdc6d37980
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1d51931c6932ab99fa294c5c6fcc0a427232707fbae00a63d558de119c2c3df8869626e2eb83c41b83f6553486214ba4add13aa483e5f8e65b1642e1c0c09a1
|
7
|
+
data.tar.gz: 1800dea3ebee9e095ab9461d0a565878559b6407c8c028f9f5b952dadb960bb820cacdfafe51eb38c2deec406e035d5cb1331a1233b4a9a691492f29ba3f5510
|
@@ -20,15 +20,18 @@ module Ocean
|
|
20
20
|
included do
|
21
21
|
if defined? ActiveRecord
|
22
22
|
rescue_from ActiveRecord::RecordNotUnique,
|
23
|
-
ActiveRecord::StatementInvalid
|
23
|
+
ActiveRecord::StatementInvalid,
|
24
|
+
OceanDynamo::RecordNotSaved do |x|
|
24
25
|
render_api_error 422, "Resource not unique"
|
25
26
|
end
|
26
27
|
|
27
|
-
rescue_from ActiveRecord::StaleObjectError
|
28
|
+
rescue_from ActiveRecord::StaleObjectError,
|
29
|
+
OceanDynamo::RecordInConflict do |x|
|
28
30
|
render_api_error 409, "Stale #{x.record.class.name}"
|
29
31
|
end
|
30
32
|
|
31
|
-
rescue_from ActiveRecord::RecordInvalid
|
33
|
+
rescue_from ActiveRecord::RecordInvalid,
|
34
|
+
OceanDynamo::RecordInvalid do |x|
|
32
35
|
render_validation_errors x.record, except: ocean_resource_controller_no_validation_errors_on
|
33
36
|
end
|
34
37
|
end
|
data/lib/ocean/version.rb
CHANGED