rails_failover 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -1
- data/lib/rails_failover/active_record/railtie.rb +8 -8
- data/lib/rails_failover/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22d00b2fbfa1a5c8fc28cae9244e93700885a41da8f1a824bf0c381d4606fafa
|
4
|
+
data.tar.gz: 6e9763206550dfa0101ca5680f740aae32ec9d8d452b469dc7d14c033848c56c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e9fafd722150cda45594b10ff642b4296c29e14bd604a8c0c8cd1fbc89706bbcd3b339c5043478056d32302c13d59b510fb77eaa0c248eb363527cf90d74715
|
7
|
+
data.tar.gz: 55dd5bde9d208dbf9103a73474af639ef03447e4aba5c6012937670b6f627cc5119bcd09cc8559ec6ded4b7fc895e2190d55662acf5b79e5592e8f548fb4e32d
|
data/CHANGELOG.md
CHANGED
@@ -5,7 +5,9 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
-
## [
|
8
|
+
## [2.0.1] - 2023-05-30
|
9
|
+
|
10
|
+
- FIX: Use `next` instead of `break` to avoid a local jump error
|
9
11
|
|
10
12
|
## [2.0.0] - 2023-05-16
|
11
13
|
|
@@ -6,7 +6,7 @@ module RailsFailover
|
|
6
6
|
initializer "rails_failover.init", after: "active_record.initialize_database" do |app|
|
7
7
|
app.config.active_record_rails_failover = false
|
8
8
|
config = RailsFailover::ActiveRecord.config
|
9
|
-
|
9
|
+
next unless config[:replica_host] && config[:replica_port]
|
10
10
|
|
11
11
|
app.config.active_record_rails_failover = true
|
12
12
|
::ActiveSupport.on_load(:active_record) do
|
@@ -21,14 +21,14 @@ module RailsFailover
|
|
21
21
|
end
|
22
22
|
|
23
23
|
initializer "rails_failover.insert_middleware" do |app|
|
24
|
-
|
25
|
-
ActionDispatch::DebugExceptions.register_interceptor do |request, exception|
|
26
|
-
RailsFailover::ActiveRecord::Interceptor.handle(request, exception)
|
27
|
-
end
|
24
|
+
next unless app.config.active_record_rails_failover
|
28
25
|
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
ActionDispatch::DebugExceptions.register_interceptor do |request, exception|
|
27
|
+
RailsFailover::ActiveRecord::Interceptor.handle(request, exception)
|
28
|
+
end
|
29
|
+
|
30
|
+
if !skip_middleware?(app.config)
|
31
|
+
app.middleware.unshift(RailsFailover::ActiveRecord::Middleware)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|