findbug 0.3.1 → 0.3.3
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/lib/findbug/engine.rb +0 -8
- data/lib/findbug/railtie.rb +12 -0
- data/lib/findbug/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: 616e1bc054f2658af793f1c309250e0037430bdf162b2593d6c6506426116a40
|
|
4
|
+
data.tar.gz: d19ed012c13b738227a25b05aef496e2a6ad9a67e79e68b5eb13a98415dd52ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cf42ad84ee1a74b468acf35648c096c1ecdcd56d1ffa529b87e0c6626fcfa46f129ac7d14d1852fd38dcbbae37e9282a5b6efdbb2e79be808aa95927671c35ff
|
|
7
|
+
data.tar.gz: 360185e9086ce255b0764cd15821cf2de5c46ffcb4a3863185fcb31f16c8efd27572eb61b7d080c607dd14462a87a61dd20103416b60fa81db14b95443c56e65
|
data/lib/findbug/engine.rb
CHANGED
|
@@ -73,14 +73,6 @@ module Findbug
|
|
|
73
73
|
end
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
-
# Load models after ActiveRecord is ready
|
|
77
|
-
# This is important for multi-tenant setups (Apartment) where excluded_models
|
|
78
|
-
# are resolved early in the boot process
|
|
79
|
-
initializer "findbug.load_models", after: :load_config_initializers do
|
|
80
|
-
require_relative "../../app/models/findbug/error_event"
|
|
81
|
-
require_relative "../../app/models/findbug/performance_event"
|
|
82
|
-
end
|
|
83
|
-
|
|
84
76
|
# NOTE: We intentionally do NOT add session/flash middleware here.
|
|
85
77
|
# Adding middleware to API-mode apps would change their behavior
|
|
86
78
|
# (e.g., showing HTML error pages instead of JSON).
|
data/lib/findbug/railtie.rb
CHANGED
|
@@ -50,6 +50,18 @@ module Findbug
|
|
|
50
50
|
# - All models to be loaded
|
|
51
51
|
#
|
|
52
52
|
class Railtie < Rails::Railtie
|
|
53
|
+
# Load models early for multi-tenant gems (Apartment/ros-apartment)
|
|
54
|
+
#
|
|
55
|
+
# Apartment resolves excluded_models via Object.const_get during its
|
|
56
|
+
# initializer. We need our models loaded before that happens.
|
|
57
|
+
# Using :load_active_record hook ensures ActiveRecord::Base is available.
|
|
58
|
+
#
|
|
59
|
+
initializer "findbug.load_models", after: :load_active_record do
|
|
60
|
+
models_path = File.expand_path("../../app/models/findbug", __dir__)
|
|
61
|
+
require "#{models_path}/error_event"
|
|
62
|
+
require "#{models_path}/performance_event"
|
|
63
|
+
end
|
|
64
|
+
|
|
53
65
|
# Register our middleware to catch exceptions
|
|
54
66
|
#
|
|
55
67
|
# MIDDLEWARE ORDER MATTERS!
|
data/lib/findbug/version.rb
CHANGED