lev 2.2.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/lev/routine.rb +20 -4
- data/lib/lev/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDNmNjBkMTY4YWExNTJlYTE0YjViMjc4NGUyNzIwZTY0N2ExN2NjZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjU2YmVkZGExY2I2MTU5Njk2N2NiOWFkODZhYzc1NmQ3OGY0MDRmNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjFmZjA2ZmZiODUzY2I2MDQ4ZTk3YTU1NDQ2ODQyNGM3MmNlYzFiMjZmNDY3
|
10
|
+
ZDM4MjBhMGU4MjE5Zjg4MjcwY2E3OTcxNTUzZDAyMTMwZWFmZjQ4ZmFiNjgy
|
11
|
+
MjIyYmVlMmE0ZTc4NWUxYTRlMTlkMDRmNDg0YWMzZjJlNmI1YWM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjQ4NzQwZmEwOTczNzAxZjUwYzQ3MGNmMDYxNjhiNGI2NGVjM2I1YWU2ZTE0
|
14
|
+
NGM2MmQ4YzExNjI1MzU5Yjk1Y2Q0YWIzMGIzODE5NDVmMWI3ZjJjODYyNjlk
|
15
|
+
NGZkYjY2ZTAwMTg1NmZhNjgyMzdhYTU2OWNmNjcxODA0MzEwNzk=
|
data/lib/lev/routine.rb
CHANGED
@@ -406,10 +406,26 @@ module Lev
|
|
406
406
|
|
407
407
|
def in_transaction(options={})
|
408
408
|
if transaction_run_by?(self)
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
409
|
+
isolation_symbol = self.class.transaction_isolation.symbol
|
410
|
+
if ActiveRecord::VERSION::MAJOR >= 4
|
411
|
+
begin
|
412
|
+
ActiveRecord::Base.transaction(isolation: isolation_symbol) do
|
413
|
+
yield
|
414
|
+
raise ActiveRecord::Rollback if errors?
|
415
|
+
end
|
416
|
+
rescue ActiveRecord::TransactionIsolationError
|
417
|
+
# Silently ignore isolation errors
|
418
|
+
ActiveRecord::Base.transaction do
|
419
|
+
yield
|
420
|
+
raise ActiveRecord::Rollback if errors?
|
421
|
+
end
|
422
|
+
end
|
423
|
+
else
|
424
|
+
ActiveRecord::Base.isolation_level(isolation_symbol) do
|
425
|
+
ActiveRecord::Base.transaction do
|
426
|
+
yield
|
427
|
+
raise ActiveRecord::Rollback if errors?
|
428
|
+
end
|
413
429
|
end
|
414
430
|
end
|
415
431
|
else
|
data/lib/lev/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Slavinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|