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: bccd15f47c53c05f114d5b3df06142353c216ff39f4d8468c6f1b483f383aa80
4
- data.tar.gz: f8bdfafb7fa77ab9dfba3922bf1ca999d5b6d4d0ec7df6aa0c71cf090bc67466
3
+ metadata.gz: 024d8f6fa0f65112e4d673192635627ede7a89dfa612673eb4262cc83f952ed1
4
+ data.tar.gz: 5cb13bf8b39e72528187d77d8d6e3aeb7e316f265f7513dc8f5db59a90662ff7
5
5
  SHA512:
6
- metadata.gz: 6929c579900726f0ab6d42986ddf80d8eb0f386f61ebe5fb78ea550c4b85c7eadecb9fb594ce99ba8460b98e5942a5bfdb58d5491a9eff87028841a8acd74d18
7
- data.tar.gz: e172acf343ef11c53d43835f4af8a39b03247af6e18e01be4da5ea7d4a4ad758a799990d8ad35a34a69fb62af04fdcbf28fd1a6330ef6764d4a16bb7901c24c2
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
@@ -1,3 +1,3 @@
1
1
  module DatabaseValidations
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Demin