sinatra-activerecord 2.0.26 → 2.0.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sinatra/activerecord.rb +12 -2
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 05d537eb2fdbf804368238de55a331b022b726b8dd29b573395250747e2c1266
4
- data.tar.gz: 7f40465c790d5d84bbc18ad4fe8e878dd3084a016f17dc22e444e4b2258b7378
3
+ metadata.gz: 8f3fbe6e520369fb04183ec09a07a3ca70108a7f6bd3f9ecf7a4009862ec30a4
4
+ data.tar.gz: 310aab0d4d4331f3c28e57ce84862b43046c9a5746275f00488b840a8cb93a32
5
5
  SHA512:
6
- metadata.gz: 2676fee4da8f0e09628cadf96252c8956fabf1d056dd25f401e63e48c70485b635320eaf1444df9667c9b817f2a736f49ecab685e4819cc247fced932170f8de
7
- data.tar.gz: c8564822e0f10cea6350a8e3067116d386f9462d0290abe2a344b7ab7d2df5c1ea2fb398a7441e8c7d5799a26fe61b27bdf0e3baf37aa48312723ad1692ec318
6
+ metadata.gz: 3e22dd1d45269cd1d7818a9264da656693084a67b144a4bfd8a839ff1f05dc1beb03cf3b9201288881e25daed54d4c77e0a2dec1ea21f8117e806f8f819ac385
7
+ data.tar.gz: a4abfe0c12ca022a8acf8f34103903ab35cf0056a394cb51529927fd648e9dff32f670dec2d2294f26b826c180b7ffdf765ee04cc102628eb55730658b60aedd
@@ -59,8 +59,18 @@ module Sinatra
59
59
  app.helpers ActiveRecordHelper
60
60
 
61
61
  # re-connect if database connection dropped (Rails 3 only)
62
- app.before { ActiveRecord::Base.verify_active_connections! if ActiveRecord::Base.respond_to?(:verify_active_connections!) }
63
- app.after { ActiveRecord::Base.clear_active_connections! }
62
+ app.before do
63
+ if ActiveRecord::VERSION::MAJOR == 3
64
+ ActiveRecord::Base.verify_active_connections! if ActiveRecord::Base.respond_to?(:verify_active_connections!)
65
+ end
66
+ end
67
+ app.after do
68
+ if ActiveRecord::VERSION::MAJOR < 7
69
+ ActiveRecord::Base.clear_active_connections!
70
+ else
71
+ ActiveRecord::Base.connection_handler.clear_active_connections!
72
+ end
73
+ end
64
74
  end
65
75
 
66
76
  def database_file=(path)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.26
4
+ version: 2.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Mizerany
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-10-17 00:00:00.000000000 Z
13
+ date: 2023-10-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sinatra
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
133
  requirements: []
134
- rubygems_version: 3.2.32
134
+ rubygems_version: 3.3.7
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: Extends Sinatra with ActiveRecord helpers.