ocean-rails 1.15.0 → 1.15.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 +4 -4
- data/lib/ocean/ocean_resource_controller.rb +11 -9
- 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: 19c67f131eebfdd7b791385da29ad67e15566d4c
|
4
|
+
data.tar.gz: 3cc8700d6debe7d91b4147dc51218e19b9d3e109
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba8d33698a52ead461f73dd811b928b17e6bbf203fd2daf70153ab05372ec546d9d8e3b45295d2b98342609e55a381727e05cb8adf0769f01992bec9f2ce69b8
|
7
|
+
data.tar.gz: 2c87f83ef4bbf11636fae72a91f379335cdcefa93043b7c3b747cb2d2e288d6af8234d71a3b2b5ef17a6ccb10bb4f59679a3390e9f93606e012dc26c8dec42a0
|
@@ -9,17 +9,19 @@ module Ocean
|
|
9
9
|
extend ActiveSupport::Concern
|
10
10
|
|
11
11
|
included do
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
if defined? ActiveRecord
|
13
|
+
rescue_from ActiveRecord::RecordNotUnique,
|
14
|
+
ActiveRecord::StatementInvalid do |x|
|
15
|
+
render_api_error 422, "#{controller_name.singularize.camelize} already exists"
|
16
|
+
end
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
rescue_from ActiveRecord::StaleObjectError do |x|
|
19
|
+
render_api_error 409, "Stale #{x.record.class.name}"
|
20
|
+
end
|
20
21
|
|
21
|
-
|
22
|
-
|
22
|
+
rescue_from ActiveRecord::RecordInvalid do |x|
|
23
|
+
render_validation_errors x.record
|
24
|
+
end
|
23
25
|
end
|
24
26
|
end
|
25
27
|
|
data/lib/ocean/version.rb
CHANGED