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.
- checksums.yaml +4 -4
- data/lib/sinatra/activerecord.rb +12 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f3fbe6e520369fb04183ec09a07a3ca70108a7f6bd3f9ecf7a4009862ec30a4
|
4
|
+
data.tar.gz: 310aab0d4d4331f3c28e57ce84862b43046c9a5746275f00488b840a8cb93a32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e22dd1d45269cd1d7818a9264da656693084a67b144a4bfd8a839ff1f05dc1beb03cf3b9201288881e25daed54d4c77e0a2dec1ea21f8117e806f8f819ac385
|
7
|
+
data.tar.gz: a4abfe0c12ca022a8acf8f34103903ab35cf0056a394cb51529927fd648e9dff32f670dec2d2294f26b826c180b7ffdf765ee04cc102628eb55730658b60aedd
|
data/lib/sinatra/activerecord.rb
CHANGED
@@ -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
|
63
|
-
|
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.
|
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:
|
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.
|
134
|
+
rubygems_version: 3.3.7
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: Extends Sinatra with ActiveRecord helpers.
|