sinatra-activerecord 2.0.12 → 2.0.13
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 +3 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae55471906bc043ca2e1264c3e739beffddfcbe3
|
4
|
+
data.tar.gz: 78286a61f1c3e720be4c6f7e2237ab0015286f0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cf58da73fcf3b32ccbea62d8428ee283def27d382eebc8827570788c37c326264988366280cdacee26ab0312c2b8ee40826c289c1efc28d5d2a4be674fae1e8
|
7
|
+
data.tar.gz: 8d6bb313b221964c27301e23c4555b7141a30a444baad640f92b2bf758d08fa22baea6d3f71aaecd3825cb95483449ac0b912c7df134fef5094bfec6d4ce50d8
|
data/lib/sinatra/activerecord.rb
CHANGED
@@ -19,9 +19,9 @@ module Sinatra
|
|
19
19
|
if ENV['DATABASE_URL']
|
20
20
|
app.set :database, ENV['DATABASE_URL']
|
21
21
|
elsif File.exist?("#{Dir.pwd}/config/database.yml")
|
22
|
-
app.set :database_file, "#{Dir.pwd}/config/database.yml"
|
22
|
+
app.set :database_file, "#{Dir.pwd}/config/database.yml"
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
unless defined?(Rake) || [:test, :production].include?(app.settings.environment)
|
26
26
|
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
27
27
|
end
|
@@ -30,9 +30,7 @@ module Sinatra
|
|
30
30
|
|
31
31
|
# re-connect if database connection dropped (Rails 3 only)
|
32
32
|
app.before { ActiveRecord::Base.verify_active_connections! if ActiveRecord::Base.respond_to?(:verify_active_connections!) }
|
33
|
-
|
34
|
-
app.use ActiveRecord::ConnectionAdapters::ConnectionManagement
|
35
|
-
end
|
33
|
+
app.after { ActiveRecord::Base.clear_active_connections! }
|
36
34
|
end
|
37
35
|
|
38
36
|
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.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Mizerany
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-03-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|