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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTBiODNjMThhZGQwZTJiNjcxZTQyYjQ0NGJiZTIzOGEzMGQ4ZWMzNQ==
4
+ ZDNmNjBkMTY4YWExNTJlYTE0YjViMjc4NGUyNzIwZTY0N2ExN2NjZg==
5
5
  data.tar.gz: !binary |-
6
- OTliM2JkYzdiZTYwNjZlNTlhZWJmYzY2ZTM3YzJmZDQzODczMDJmNA==
6
+ NjU2YmVkZGExY2I2MTU5Njk2N2NiOWFkODZhYzc1NmQ3OGY0MDRmNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjYzMTZkNmUxNWE1OTI0ZWQwZmY5OGJjZDdiMjc2MGM4MmM2ZjQzNjkzN2E0
10
- NjM1OGMwYzEwZWVmMTJhN2E4MzNmYmNmZWE2N2E3OTU1OGQ3YTJhYzAzZmM5
11
- ZDgyODc4YThhZDRkYzJmZTMzZGNjZjhiMDU1NmVlOGYxMzc4N2I=
9
+ ZjFmZjA2ZmZiODUzY2I2MDQ4ZTk3YTU1NDQ2ODQyNGM3MmNlYzFiMjZmNDY3
10
+ ZDM4MjBhMGU4MjE5Zjg4MjcwY2E3OTcxNTUzZDAyMTMwZWFmZjQ4ZmFiNjgy
11
+ MjIyYmVlMmE0ZTc4NWUxYTRlMTlkMDRmNDg0YWMzZjJlNmI1YWM=
12
12
  data.tar.gz: !binary |-
13
- ZmVkNGFlYTY3YjQ0ZjFkMjc1MmRhMmNlYTBmMTU5ODQzMGExNmQ1NGI3Mjlh
14
- ZjdmYmE4OWU5YjY4ZGFlMjY5YTNkMzE4ZDFjMzliYTdjNzI2NmQyOWE2YTIx
15
- YmJjYzc0NThhY2I4MWY1NzI4M2I2NTc5NWFlMmY2MzU4MGI1ZGU=
13
+ YjQ4NzQwZmEwOTczNzAxZjUwYzQ3MGNmMDYxNjhiNGI2NGVjM2I1YWU2ZTE0
14
+ NGM2MmQ4YzExNjI1MzU5Yjk1Y2Q0YWIzMGIzODE5NDVmMWI3ZjJjODYyNjlk
15
+ NGZkYjY2ZTAwMTg1NmZhNjgyMzdhYTU2OWNmNjcxODA0MzEwNzk=
@@ -406,10 +406,26 @@ module Lev
406
406
 
407
407
  def in_transaction(options={})
408
408
  if transaction_run_by?(self)
409
- ActiveRecord::Base.isolation_level( self.class.transaction_isolation.symbol ) do
410
- ActiveRecord::Base.transaction do
411
- yield
412
- raise ActiveRecord::Rollback if errors?
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
@@ -1,3 +1,3 @@
1
1
  module Lev
2
- VERSION = "2.2.0"
2
+ VERSION = "2.2.1"
3
3
  end
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.0
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-08-15 00:00:00.000000000 Z
11
+ date: 2014-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel