roo_on_rails 2.2.1 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1793f84c10a291804b1d7388cf98f5335bb2b65e983948b10bb37341dc46067d
4
- data.tar.gz: c2e3632d75d7b58edf80f0c4091657b7012d5e8bb6e42aa764f8da922fd3f3a0
3
+ metadata.gz: 779360e44252a1b944aa8591e5a1996a7f461394fa8907ddf41428bb7212743d
4
+ data.tar.gz: f2a27f71b29dacf50739cabcdcd88cdfc89d37deeaf1bae8138a8ac929336c75
5
5
  SHA512:
6
- metadata.gz: 69f25ad9734cb3ffc9b19af0a9b62a3a15e7b886e5f853d203205319e31098a9b6b6b517625f5082d3bdc0f002651007102a8a4ccbb452ccf47cf30e4fe27b8e
7
- data.tar.gz: e08116946c5330dbcd17212d266703e97cbf4746d40ce45caa7f682d1ca3b76b7dcc50f1fc0b622822bf0a125e568955d68d5dd279da6b18cdb3212d503cbb74
6
+ metadata.gz: bac595bc2dbcfcabfb479edbf0278399ce3911868b2da02b88051533503ee3891660d28c057e3a2f5301386990effdd5ce649630bc357a4d01db3796af1a1646
7
+ data.tar.gz: 220e8c0bb4b9d1734a8850bdb573adeade6c5f7782be7cf9ed09e7010222f0f2196519a2fc6831585a8bdfb88fd864b60af37aa3d02008e0cc5ca0c28750d788
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
- # v2.2.0
1
+ # v2.2.2
2
+ - Drops Railtie::Database. STATEMENT_TIMEOUT no longer set by this gem.
3
+
4
+ # v2.2.1
2
5
  - Drops ActiveRecord::Base.establish_connection from Railtie::Database.
6
+
3
7
  # v2.2.0
4
8
 
5
9
  Breaking changes:
@@ -1,3 +1,3 @@
1
1
  module RooOnRails
2
- VERSION = '2.2.1'.freeze
2
+ VERSION = '2.2.2'.freeze
3
3
  end
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.1
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