database_validations 0.3.2 → 0.3.3
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 024d8f6fa0f65112e4d673192635627ede7a89dfa612673eb4262cc83f952ed1
|
4
|
+
data.tar.gz: 5cb13bf8b39e72528187d77d8d6e3aeb7e316f265f7513dc8f5db59a90662ff7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d8b6308e29ef341fef318a2ef3a91288b7f56f6275fe07e05980753eaf6ac83a6bf6b036fe4c6381c862294eae74246e2770ca42f429d06b7715bf0a026c479
|
7
|
+
data.tar.gz: 4e5bc1cfb78d5db9d0397cd5f0675d7f8bf2ceca15f241aadcd1ad93091d42a401e16afeb54feb436f9e9d944fc817400d3124f211f7493e73609a5cf5a6f81d
|
@@ -19,14 +19,14 @@ module DatabaseValidations
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def save(options = {})
|
22
|
-
super
|
22
|
+
ActiveRecord::Base.connection.transaction(requires_new: true) { super }
|
23
23
|
rescue ActiveRecord::RecordNotUnique => e
|
24
24
|
DatabaseValidations::Helpers.handle_unique_error(self, e)
|
25
25
|
false
|
26
26
|
end
|
27
27
|
|
28
28
|
def save!(options = {})
|
29
|
-
super
|
29
|
+
ActiveRecord::Base.connection.transaction(requires_new: true) { super }
|
30
30
|
rescue ActiveRecord::RecordNotUnique => e
|
31
31
|
DatabaseValidations::Helpers.handle_unique_error(self, e)
|
32
32
|
raise ActiveRecord::RecordInvalid, self
|