ocean-rails 1.15.0 → 1.15.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce9a28ccf97e9bf1ee5c4905451a525fd31f989d
4
- data.tar.gz: 9abb086155560c5c2673a0c9fc67f461edbe196d
3
+ metadata.gz: 19c67f131eebfdd7b791385da29ad67e15566d4c
4
+ data.tar.gz: 3cc8700d6debe7d91b4147dc51218e19b9d3e109
5
5
  SHA512:
6
- metadata.gz: 6aa5c1b90969a5153777aaeefbc5ede1ddbfd21e6451fdbf82472eb5abc685e6e7e7f4b4396c13f20b507f568f9bbc01f0ee9aad7ff5a6ac5c8b9618f7367875
7
- data.tar.gz: d5be6dbac22701ece003f860a5f55c97125231903ef70b96e25ccc2e71e45c7f0775e41bb603cfcae74dd098726c3ed66518f123bd3a20a504d8dcf2f5d34693
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
- rescue_from ActiveRecord::RecordNotUnique,
13
- ActiveRecord::StatementInvalid do |x|
14
- render_api_error 422, "#{controller_name.singularize.camelize} already exists"
15
- end
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
- rescue_from ActiveRecord::StaleObjectError do |x|
18
- render_api_error 409, "Stale #{x.record.class.name}"
19
- end
18
+ rescue_from ActiveRecord::StaleObjectError do |x|
19
+ render_api_error 409, "Stale #{x.record.class.name}"
20
+ end
20
21
 
21
- rescue_from ActiveRecord::RecordInvalid do |x|
22
- render_validation_errors x.record
22
+ rescue_from ActiveRecord::RecordInvalid do |x|
23
+ render_validation_errors x.record
24
+ end
23
25
  end
24
26
  end
25
27
 
@@ -1,3 +1,3 @@
1
1
  module Ocean
2
- VERSION = "1.15.0"
2
+ VERSION = "1.15.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocean-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.0
4
+ version: 1.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson