rails-pg-adapter 0.1.1 → 0.1.3

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: 8577c301e9dc09d6bcc0bc452be125fe2791f57d47be5fc1f03dbeac36ef504f
4
- data.tar.gz: 017a545ce842f2834e742185a081d27929e4135ff77c15d6b639d0b609a1bc21
3
+ metadata.gz: '0922aa74310b9970afc80440e44af2cda8412588f10997b64c1f059dc87c1f44'
4
+ data.tar.gz: 890a5148ac39ce80bb3a5d8c0c9c7547d6f71fbf6b5ad28c9412f3fe4f7e50f2
5
5
  SHA512:
6
- metadata.gz: 0cd3b0dab08d6ac37d2cb82c0c39e153757e193a1b4057ecf5d57ad78aab94b3f5347f2489218462ccee81ea0c36d61523312fbf8a404a16c8a997f9552f6b34
7
- data.tar.gz: 3c0e6b010aec4416941808df63676f779c51e3986299e772ed8fb873509c5f7dab45fcd833dd06b68e567b7dcebd8814ac50f7de4b756651a4929df83e335c68
6
+ metadata.gz: 8b0547c9f969da901988e9d27ec317d319903d9c01ea8d543ff8ba4fe174f307ea427e44878e4c4c70c15ed232d805f48fbd93a94ea06402e07b017ba88b1125
7
+ data.tar.gz: 3906ce61975f0477b396b32c150c81f075c239094b055a92318d82460a053140ecdd1794916fe1940ea13d2b8ac95f37e7bb5242fff61c73a1d2d3220a32c2e9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.1.3] - 2023-04-04
2
+
3
+ - Bug fix: Always prepend the patch on boot to avoid issues with loading the monkey patch on some Rails installations
4
+
5
+ ## [0.1.2] - 2023-03-29
6
+
7
+ - Bug fix: Ensure RailsPgAdapter constant is discoverable
8
+
1
9
  ## [0.1.1] - 2023-03-29
2
10
 
3
11
  - Initial release
data/Gemfile CHANGED
@@ -7,6 +7,7 @@ group :development do
7
7
  gem "pry"
8
8
  gem "rake"
9
9
  gem "rspec"
10
+ gem "rspec-rails"
10
11
  gem "rubocop"
11
12
  gem "rubocop-rails"
12
13
  gem "rubocop-rspec"
@@ -1,8 +1,11 @@
1
+ # rubocop:disable Naming/FileName
1
2
  # frozen_string_literal: true
2
3
 
3
- require "version"
4
+ require "rails_pg_adapter/version"
4
5
  require "rails_pg_adapter/configuration"
5
6
  require "rails_pg_adapter/patch"
6
7
 
7
8
  module RailsPgAdapter
8
9
  end
10
+
11
+ # rubocop:enable Naming/FileName
@@ -29,10 +29,6 @@ module RailsPgAdapter
29
29
  RailsPgAdapter.configuration.add_reset_column_information_patch || false
30
30
  end
31
31
 
32
- def self.enabled?
33
- failover_patch? || reset_column_information_patch?
34
- end
35
-
36
32
  def self.reset_configuration
37
33
  @configuration = Configuration.new({
38
34
  add_failover_patch: false,
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+ require "active_record/connection_adapters/postgresql_adapter"
2
3
 
3
4
  module RailsPgAdapter
4
5
  module Patch
@@ -66,10 +67,10 @@ module RailsPgAdapter
66
67
 
67
68
  def warn(msg)
68
69
  return unless defined?(Rails)
69
- ::Rails.logger.warn("[RailsPgAdapter::Patch] #{msg}")
70
-
70
+ return if Rails.logger.nil?
71
+ ::Rails.logger.warn("[RailsPgAdapter::Patch] #{msg}")
71
72
  end
72
73
  end
73
74
  end
74
75
 
75
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(RailsPgAdapter::Patch) if RailsPgAdapter.enabled?
76
+ ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.prepend(RailsPgAdapter::Patch)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsPgAdapter
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-pg-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tines Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-29 00:00:00.000000000 Z
11
+ date: 2023-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "<"
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '7.0'
19
+ version: '6'
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: '7.0'
26
+ version: '6'
27
27
  description: This project allows you to monkey patch ActiveRecord (PostgreSQL) and
28
28
  auto-heal applications in production when PostgreSQL database fails over or when
29
29
  a cached column (in ActiveRecord schema cache) is removed from the database from
@@ -43,10 +43,10 @@ files:
43
43
  - README.md
44
44
  - Rakefile
45
45
  - docker-compose.yml
46
- - lib/rails_pg_adapter.rb
46
+ - lib/rails-pg-adapter.rb
47
47
  - lib/rails_pg_adapter/configuration.rb
48
48
  - lib/rails_pg_adapter/patch.rb
49
- - lib/version.rb
49
+ - lib/rails_pg_adapter/version.rb
50
50
  homepage: http://github.com/tines/rails-pg-adapter
51
51
  licenses:
52
52
  - MIT