roo_on_rails 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/lib/roo_on_rails/version.rb +1 -1
- data/lib/roo_on_rails.rb +0 -1
- metadata +1 -2
- data/lib/roo_on_rails/railties/database.rb +0 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 779360e44252a1b944aa8591e5a1996a7f461394fa8907ddf41428bb7212743d
|
4
|
+
data.tar.gz: f2a27f71b29dacf50739cabcdcd88cdfc89d37deeaf1bae8138a8ac929336c75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bac595bc2dbcfcabfb479edbf0278399ce3911868b2da02b88051533503ee3891660d28c057e3a2f5301386990effdd5ce649630bc357a4d01db3796af1a1646
|
7
|
+
data.tar.gz: 220e8c0bb4b9d1734a8850bdb573adeade6c5f7782be7cf9ed09e7010222f0f2196519a2fc6831585a8bdfb88fd864b60af37aa3d02008e0cc5ca0c28750d788
|
data/CHANGELOG.md
CHANGED
data/lib/roo_on_rails/version.rb
CHANGED
data/lib/roo_on_rails.rb
CHANGED
@@ -6,7 +6,6 @@ end
|
|
6
6
|
if defined?(Rails)
|
7
7
|
require 'dotenv/rails-now'
|
8
8
|
require 'roo_on_rails/railties/env'
|
9
|
-
require 'roo_on_rails/railties/database'
|
10
9
|
require 'roo_on_rails/railties/http'
|
11
10
|
require 'roo_on_rails/railties/sidekiq_integration'
|
12
11
|
require 'roo_on_rails/railties/rake_tasks'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roo_on_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Letessier
|
@@ -461,7 +461,6 @@ files:
|
|
461
461
|
- lib/roo_on_rails/papertrail_client.rb
|
462
462
|
- lib/roo_on_rails/rack/populate_env_from_jwt.rb
|
463
463
|
- lib/roo_on_rails/rack/safe_timeouts.rb
|
464
|
-
- lib/roo_on_rails/railties/database.rb
|
465
464
|
- lib/roo_on_rails/railties/env.rb
|
466
465
|
- lib/roo_on_rails/railties/google_oauth.rb
|
467
466
|
- lib/roo_on_rails/railties/http.rb
|
@@ -1,49 +0,0 @@
|
|
1
|
-
module RooOnRails
|
2
|
-
module Railties
|
3
|
-
class Database < Rails::Railtie
|
4
|
-
initializer 'roo_on_rails.database', after: 'active_record.initialize_database' do
|
5
|
-
ActiveSupport.on_load :active_record do
|
6
|
-
Rails.logger.debug('[roo_on_rails.database] loading')
|
7
|
-
|
8
|
-
if Gem::Version.new(Rails.version) >= Gem::Version.new('6.1')
|
9
|
-
configs = ActiveRecord::Base.configurations.configurations
|
10
|
-
old_url_config = ActiveRecord::Base.configurations.configs_for(env_name: Rails.env, name: 'primary')
|
11
|
-
new_config_hash = old_url_config.configuration_hash.deep_dup
|
12
|
-
new_config_hash[:variables] ||= {}
|
13
|
-
statement_timeout = ENV.fetch('DATABASE_STATEMENT_TIMEOUT', 200)
|
14
|
-
# Use -1 to disable setting the statement timeout
|
15
|
-
new_config_hash[:variables][:statement_timeout] = statement_timeout unless statement_timeout == '-1'
|
16
|
-
new_config_hash[:reaping_frequency] = ENV['DATABASE_REAPING_FREQUENCY'] if ENV.key?('DATABASE_REAPING_FREQUENCY')
|
17
|
-
if old_url_config.respond_to?(:url)
|
18
|
-
new_url_config = ActiveRecord::DatabaseConfigurations::UrlConfig.new(
|
19
|
-
old_url_config.env_name,
|
20
|
-
old_url_config.name,
|
21
|
-
old_url_config.url,
|
22
|
-
new_config_hash
|
23
|
-
)
|
24
|
-
else
|
25
|
-
new_url_config = ActiveRecord::DatabaseConfigurations::HashConfig.new(
|
26
|
-
old_url_config.env_name,
|
27
|
-
old_url_config.name,
|
28
|
-
new_config_hash
|
29
|
-
)
|
30
|
-
end
|
31
|
-
configs.delete(old_url_config)
|
32
|
-
configs << new_url_config
|
33
|
-
else
|
34
|
-
config = ActiveRecord::Base.configurations[Rails.env]
|
35
|
-
config['variables'] ||= {}
|
36
|
-
statement_timeout = ENV.fetch('DATABASE_STATEMENT_TIMEOUT', 200)
|
37
|
-
# Use -1 to disable setting the statement timeout
|
38
|
-
unless statement_timeout == '-1'
|
39
|
-
config['variables']['statement_timeout'] = statement_timeout
|
40
|
-
end
|
41
|
-
if ENV.key?('DATABASE_REAPING_FREQUENCY')
|
42
|
-
config['reaping_frequency'] = ENV['DATABASE_REAPING_FREQUENCY']
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|