sequel-activerecord_connection 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c11ff9b3633981f462112bbbb844ec6033522314b6849d66b1f1868976521549
4
- data.tar.gz: 6ef2ebc50251b4e0f894d95e4953afbabd9b1a955a226809053a664788c94bc9
3
+ metadata.gz: b3007b81d8906ff8ddbac1e5e5adadbc555eddacf6dbd7ef92d9062a72d3a751
4
+ data.tar.gz: 9e1ee7db2f4ee482abe17ee893d9f222325ec95f24e6a3ada63b1f5c10f94634
5
5
  SHA512:
6
- metadata.gz: 867693e62bde77afd9ff107f73670b488dbdd3f53ab1665da27a59d560d2737c045446e1d1995c49f9f700cc215303167404349c4c275597b030c5b65637c7e8
7
- data.tar.gz: 0ceb8dc99f066df61850fdd596d3dbb5543fa437ffe428a3722d2d77a89e9227edccb57023d0d83834c1b9d846f2d06ccbac20c9904d19ba79c9db8470a5cbb8
6
+ metadata.gz: d73aba0aa9bd41b9a66fab9d3da6db349bf0b2ae39fb3354243146485b5b647f00c55d89887d026752dc5b007fc2504f2d69a01e86f1f712d0494277cb8b4af1
7
+ data.tar.gz: cfbb41ff961d3c5b83d0ab21cb90706ff5a472e666dc469fbf1f9be4dd4b6d8407b5e93f89cdc6d2778e1fc3a6c0fd99a205e51a49851af129f0455efdb0a1fa
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # Sequel::ActiveRecordConnection
2
2
 
3
3
  This is an extension for [Sequel] that allows it to reuse an existing
4
- ActiveRecord connection for database interaction. It supports `postgresql`,
5
- `mysql2` and `sqlite3` adapters.
4
+ ActiveRecord connection for database interaction. It works on ActiveRecord 4.2
5
+ or higher, and supports the built-in `postgresql`, `mysql2` and `sqlite3`
6
+ adapters.
6
7
 
7
8
  This can be useful if you're using a library that uses Sequel for database
8
9
  interaction (e.g. [Rodauth]), but you want to avoid creating a separate
@@ -75,6 +75,14 @@ module Sequel
75
75
  def activerecord_connection
76
76
  activerecord_model.connection
77
77
  end
78
+
79
+ def activesupport_interlock(&block)
80
+ if ActiveSupport::Dependencies.respond_to?(:interlock)
81
+ ActiveSupport::Dependencies.interlock.permit_concurrent_loads(&block)
82
+ else
83
+ yield
84
+ end
85
+ end
78
86
  end
79
87
 
80
88
  Database.register_extension(:activerecord_connection, ActiveRecordConnection)
@@ -19,7 +19,7 @@ module Sequel
19
19
  end
20
20
 
21
21
  activerecord_connection.send(:log, sql) do
22
- ActiveSupport::Dependencies.interlock.permit_concurrent_loads do
22
+ activesupport_interlock do
23
23
  case type
24
24
  when :select
25
25
  activerecord_raw_connection.query(sql, &block)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "sequel-activerecord_connection"
3
- spec.version = "0.2.1"
3
+ spec.version = "0.2.2"
4
4
  spec.authors = ["Janko Marohnić"]
5
5
  spec.email = ["janko.marohnic@gmail.com"]
6
6
 
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.required_ruby_version = Gem::Requirement.new(">= 2.2.0")
13
13
 
14
14
  spec.add_dependency "sequel", ">= 4.0", "< 6"
15
- spec.add_dependency "activerecord", ">= 5.0", "< 7"
15
+ spec.add_dependency "activerecord", ">= 4.2", "< 7"
16
16
 
17
17
  spec.add_development_dependency "pg", "~> 1.0"
18
18
  spec.add_development_dependency "mysql2", "~> 0.5"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel-activerecord_connection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janko Marohnić
@@ -36,7 +36,7 @@ dependencies:
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '5.0'
39
+ version: '4.2'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
42
  version: '7'
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: '5.0'
49
+ version: '4.2'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '7'