sinatra-activerecord 2.0.17 → 2.0.18
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 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc810f00cad9c2ea25e192e3561b105d86b59470b74f1ed87989956516582a07
|
4
|
+
data.tar.gz: 6ed1bf13fb1bf569ecd6f13c2e30e733f46f479b78b09202dba084498c7f0788
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '090c13e2217b2ca868a6224422211a4c22ae95f7a6d2b36819714e0f866153cc05f05b9b6d557a99e3aa1ab69a4c3f62dc57022d9c1c0439c3d07d0cb6474a9b'
|
7
|
+
data.tar.gz: dc906d8a9fcbc2118f743aaba8c1a19ac0816ed7b5353d0a21fe7308a4e500fbe09ef328d640555600ce5f93ffcb4a2ebfd9890d9e983a520c9c52596a117138
|
data/lib/sinatra/activerecord.rb
CHANGED
@@ -43,13 +43,21 @@ module Sinatra
|
|
43
43
|
if spec.is_a?(Hash) and spec.symbolize_keys[environment.to_sym]
|
44
44
|
ActiveRecord::Base.configurations = spec.stringify_keys
|
45
45
|
ActiveRecord::Base.establish_connection(environment.to_sym)
|
46
|
-
elsif spec.is_a?(Hash)
|
47
|
-
ActiveRecord::Base.configurations
|
46
|
+
elsif spec.is_a?(Hash)
|
47
|
+
ActiveRecord::Base.configurations = {
|
48
|
+
environment.to_s => spec.stringify_keys
|
49
|
+
}
|
50
|
+
|
48
51
|
ActiveRecord::Base.establish_connection(spec.stringify_keys)
|
49
52
|
else
|
53
|
+
if Gem.loaded_specs["activerecord"].version >= Gem::Version.create('6.0')
|
54
|
+
ActiveRecord::Base.configurations ||= ActiveRecord::DatabaseConfigurations.new({}).resolve(spec)
|
55
|
+
else
|
56
|
+
ActiveRecord::Base.configurations ||= {}
|
57
|
+
ActiveRecord::Base.configurations[environment.to_s] = ActiveRecord::ConnectionAdapters::ConnectionSpecification::ConnectionUrlResolver.new(spec).to_hash
|
58
|
+
end
|
59
|
+
|
50
60
|
ActiveRecord::Base.establish_connection(spec)
|
51
|
-
ActiveRecord::Base.configurations ||= {}
|
52
|
-
ActiveRecord::Base.configurations[environment.to_s] = ActiveRecord::ConnectionAdapters::ConnectionSpecification::ConnectionUrlResolver.new(spec).to_hash
|
53
61
|
end
|
54
62
|
end
|
55
63
|
|
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.18
|
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: 2020-04-
|
12
|
+
date: 2020-04-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|