sequel-activerecord_connection 0.2.5 → 0.2.6
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: 95766ef8e2bf54388e4a139f430c42176760f2b77e0322902445414ffe3d7ddb
|
4
|
+
data.tar.gz: 35a9fe4b35ff4037299799be9d902e93a29f9d81333ddf084374a4525761a2b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93a612e4cfc3454783ba936a19518459fee958e53f8193e9f0561d65961008892a7b8c24a3189e5b2cc8620803e0da1375cd36f5c319af4adf7461656e2e462e
|
7
|
+
data.tar.gz: 526c8b8ce56b481f5fa98ff1dbd242fc9104665dab6166bd4797514ae187bfe0e9460881dc9f6783e1216323a9a0d701949de2d1972865d464a9a13c51dd4c41
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 0.2.6 (2020-07-19)
|
2
|
+
|
3
|
+
* Return block result in `Sequel::Database#transaction` (@zabolotnov87, @janko)
|
4
|
+
|
5
|
+
* Fix `Sequel::Model#save_changes` or `#save` with additional options not executing (@zabolotnov87, @janko)
|
6
|
+
|
1
7
|
## 0.2.5 (2020-06-04)
|
2
8
|
|
3
9
|
* Use `#current_timestamp_utc` for the JDBC SQLite adapter as well (@HoneyryderChuck)
|
@@ -22,31 +22,22 @@ module Sequel
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def transaction(options = {})
|
25
|
-
|
26
|
-
|
27
|
-
auto_savepoint = options.delete(:auto_savepoint)
|
28
|
-
server = options.delete(:server)
|
29
|
-
|
30
|
-
fail Error, "#{options} transaction options are currently not supported" unless options.empty?
|
31
|
-
|
32
|
-
if in_transaction?
|
33
|
-
requires_new = savepoint || Thread.current[:sequel_activerecord_auto_savepoint]
|
34
|
-
else
|
35
|
-
requires_new = true
|
25
|
+
%i[isolation num_retries before_retry prepare retry_on].each do |key|
|
26
|
+
fail Error, "#{key.inspect} transaction option is currently not supported" if options.key?(key)
|
36
27
|
end
|
37
28
|
|
38
|
-
activerecord_model.transaction(requires_new:
|
29
|
+
activerecord_model.transaction(requires_new: !in_transaction? || options[:savepoint] || Thread.current[:sequel_activerecord_auto_savepoint]) do
|
39
30
|
begin
|
40
|
-
Thread.current[:sequel_activerecord_auto_savepoint] = true if auto_savepoint
|
41
|
-
yield
|
31
|
+
Thread.current[:sequel_activerecord_auto_savepoint] = true if options[:auto_savepoint]
|
32
|
+
result = yield
|
33
|
+
raise ActiveRecord::Rollback if options[:rollback] == :always
|
34
|
+
result
|
42
35
|
rescue Sequel::Rollback => exception
|
43
|
-
raise if rollback == :reraise
|
36
|
+
raise if options[:rollback] == :reraise
|
44
37
|
raise ActiveRecord::Rollback, exception.message, exception.backtrace
|
45
38
|
ensure
|
46
|
-
Thread.current[:sequel_activerecord_auto_savepoint] = nil if auto_savepoint
|
39
|
+
Thread.current[:sequel_activerecord_auto_savepoint] = nil if options[:auto_savepoint]
|
47
40
|
end
|
48
|
-
|
49
|
-
raise ActiveRecord::Rollback if rollback == :always
|
50
41
|
end
|
51
42
|
end
|
52
43
|
|
@@ -14,6 +14,14 @@ module Sequel
|
|
14
14
|
ensure
|
15
15
|
result.clear if result
|
16
16
|
end
|
17
|
+
|
18
|
+
def transaction(options = {})
|
19
|
+
%i[deferrable read_only synchronous].each do |key|
|
20
|
+
fail Error, "#{key.inspect} transaction option is currently not supported" if options.key?(key)
|
21
|
+
end
|
22
|
+
|
23
|
+
super
|
24
|
+
end
|
17
25
|
end
|
18
26
|
end
|
19
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel-activerecord_connection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janko Marohnić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|