sequel-activerecord_connection 0.2.0 → 0.2.1

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: 8c039d5e631eab07727b3ae6f451bc04656a5f5215a1c3389c64dead44a16f2e
4
- data.tar.gz: 99402da40ca6bbbadc05dd1dfd24757368a6153a85922b705cd491c14ab54096
3
+ metadata.gz: c11ff9b3633981f462112bbbb844ec6033522314b6849d66b1f1868976521549
4
+ data.tar.gz: 6ef2ebc50251b4e0f894d95e4953afbabd9b1a955a226809053a664788c94bc9
5
5
  SHA512:
6
- metadata.gz: 6312fad7666b13a9fb6d670ef5b1806edb4cda9843b008090f69a8f5472982673f1180a16b5e903f0e26eab7ef6cdba3d9d6a762024ef28842d17f61f9d5ac68
7
- data.tar.gz: e80315a652b89d0cb13075dc72ade8d882f3a35038f998293bfbb8f3aeed8483457e80ed085fa850694e5694fbc10a7e6641ad35bd66f3df01bdb9b3e9dc21d8
6
+ metadata.gz: 867693e62bde77afd9ff107f73670b488dbdd3f53ab1665da27a59d560d2737c045446e1d1995c49f9f700cc215303167404349c4c275597b030c5b65637c7e8
7
+ data.tar.gz: 0ceb8dc99f066df61850fdd596d3dbb5543fa437ffe428a3722d2d77a89e9227edccb57023d0d83834c1b9d846f2d06ccbac20c9904d19ba79c9db8470a5cbb8
data/README.md CHANGED
@@ -158,7 +158,7 @@ DB.activerecord_model = MyModel
158
158
  ### Timezone
159
159
 
160
160
  Sequel's database timezone will be automatically set to ActiveRecord's default
161
- timezone when the extension(`:utc` by default) when the extension is loaded.
161
+ timezone (`:utc` by default) when the extension is loaded.
162
162
 
163
163
  If you happen to be changing ActiveRecord's default timezone after you've
164
164
  loaded the extension, make sure to reflect that in your Sequel database object,
@@ -57,7 +57,11 @@ module Sequel
57
57
 
58
58
  # Avoid calling Sequel's connection pool, instead use ActiveRecord.
59
59
  def synchronize(*)
60
- activerecord_connection.lock.synchronize do
60
+ if ActiveRecord.version >= Gem::Version.new("5.1.0")
61
+ activerecord_connection.lock.synchronize do
62
+ yield activerecord_raw_connection
63
+ end
64
+ else
61
65
  yield activerecord_raw_connection
62
66
  end
63
67
  end
@@ -10,9 +10,13 @@ module Sequel
10
10
  # ActiveRecord doesn't send SQLite methods Sequel expects, so we need to
11
11
  # try to replicate what ActiveRecord does around connection excecution.
12
12
  def _execute(type, sql, opts, &block)
13
- activerecord_raw_connection.extended_result_codes = true
13
+ if activerecord_raw_connection.respond_to?(:extended_result_codes=)
14
+ activerecord_raw_connection.extended_result_codes = true
15
+ end
14
16
 
15
- activerecord_connection.materialize_transactions
17
+ if ActiveRecord::VERSION::MAJOR >= 6
18
+ activerecord_connection.materialize_transactions
19
+ end
16
20
 
17
21
  activerecord_connection.send(:log, sql) do
18
22
  ActiveSupport::Dependencies.interlock.permit_concurrent_loads do
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "sequel-activerecord_connection"
3
- spec.version = "0.2.0"
3
+ spec.version = "0.2.1"
4
4
  spec.authors = ["Janko Marohnić"]
5
5
  spec.email = ["janko.marohnic@gmail.com"]
6
6
 
@@ -11,12 +11,12 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.required_ruby_version = Gem::Requirement.new(">= 2.2.0")
13
13
 
14
- spec.add_dependency "sequel", "~> 5.0"
14
+ spec.add_dependency "sequel", ">= 4.0", "< 6"
15
15
  spec.add_dependency "activerecord", ">= 5.0", "< 7"
16
16
 
17
17
  spec.add_development_dependency "pg", "~> 1.0"
18
18
  spec.add_development_dependency "mysql2", "~> 0.5"
19
- spec.add_development_dependency "sqlite3", "~> 1.4"
19
+ spec.add_development_dependency "sqlite3", "~> 1.3"
20
20
  spec.add_development_dependency "minitest"
21
21
 
22
22
  spec.files = Dir["README.md", "LICENSE.txt", "CHANGELOG.md", "lib/**/*.rb", "*.gemspec"]
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel-activerecord_connection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
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-04-29 00:00:00.000000000 Z
11
+ date: 2020-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: '4.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '6'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: '5.0'
29
+ version: '4.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '6'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: activerecord
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -78,14 +84,14 @@ dependencies:
78
84
  requirements:
79
85
  - - "~>"
80
86
  - !ruby/object:Gem::Version
81
- version: '1.4'
87
+ version: '1.3'
82
88
  type: :development
83
89
  prerelease: false
84
90
  version_requirements: !ruby/object:Gem::Requirement
85
91
  requirements:
86
92
  - - "~>"
87
93
  - !ruby/object:Gem::Version
88
- version: '1.4'
94
+ version: '1.3'
89
95
  - !ruby/object:Gem::Dependency
90
96
  name: minitest
91
97
  requirement: !ruby/object:Gem::Requirement