rails-pg-extras 5.4.3 → 5.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails-pg-extras.rb +9 -1
- data/lib/rails_pg_extras/version.rb +1 -1
- data/lib/rails_pg_extras/web/engine.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67106c52efaf5c0ae51f4a3b6fda5a717b46ced555a809a07d5b1b6d4fed75fa
|
4
|
+
data.tar.gz: d70f3fbcdb6e06d28df37aee6ff4e505709cf1880536b569cba87a080e27d9b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d499d28be5404301e0208d15446e205a5f92937cd93bec69baac01cb210f5d2070c2fbab7f9ac98bc5870c9ec1613a8be30fbbd5ac7d81368c72ccc874fea14f
|
7
|
+
data.tar.gz: a351e3c1f71c63c680b357915a68794ac17e1160db3b1cefa215ead80db9e542508b9388ceec6168be87875d9f466cfd9f74928305794901c4e06211f54c9c5c
|
data/lib/rails-pg-extras.rb
CHANGED
@@ -152,7 +152,15 @@ module RailsPgExtras
|
|
152
152
|
|
153
153
|
def self.connection
|
154
154
|
if (db_url = ENV["RAILS_PG_EXTRAS_DATABASE_URL"])
|
155
|
-
ActiveRecord::Base.establish_connection(db_url)
|
155
|
+
connector = ActiveRecord::Base.establish_connection(db_url)
|
156
|
+
|
157
|
+
if connector.respond_to?(:connection)
|
158
|
+
connector.connection
|
159
|
+
elsif connector.respond_to?(:lease_connection)
|
160
|
+
connector.lease_connection
|
161
|
+
else
|
162
|
+
raise "Unsupported connector: #{connector.class}"
|
163
|
+
end
|
156
164
|
else
|
157
165
|
ActiveRecord::Base.connection
|
158
166
|
end
|
@@ -5,7 +5,7 @@ module RailsPgExtras::Web
|
|
5
5
|
isolate_namespace RailsPgExtras::Web
|
6
6
|
config.middleware.use ActionDispatch::Flash
|
7
7
|
initializer "static assets" do |app|
|
8
|
-
app.middleware.insert_before(
|
8
|
+
app.middleware.insert_before(0, ::ActionDispatch::Static, "#{RailsPgExtras::Web::Engine.root}/assets")
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-pg-extras
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.4.
|
4
|
+
version: 5.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pawurb
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 5.4.
|
19
|
+
version: 5.4.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 5.4.
|
26
|
+
version: 5.4.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
- !ruby/object:Gem::Version
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
|
-
rubygems_version: 3.5.
|
151
|
+
rubygems_version: 3.5.23
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: Rails PostgreSQL performance database insights
|