findbug 0.3.2 → 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 -7
- data/lib/findbug/railtie.rb +13 -5
- 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
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "rails/engine"
|
|
4
|
-
require "active_record"
|
|
5
4
|
|
|
6
5
|
# Calculate the gem root path once at load time
|
|
7
6
|
# __dir__ is lib/findbug, so we go up two levels to get the gem root
|
|
8
7
|
FINDBUG_GEM_ROOT = File.expand_path("../..", __dir__)
|
|
9
8
|
|
|
10
|
-
# Require models early so they're available for multi-tenant gems (Apartment)
|
|
11
|
-
# that resolve excluded_models during boot via Object.const_get.
|
|
12
|
-
# This must happen before Apartment's initializer runs.
|
|
13
|
-
require_relative "../../app/models/findbug/error_event"
|
|
14
|
-
require_relative "../../app/models/findbug/performance_event"
|
|
15
|
-
|
|
16
9
|
# Require controllers (needed for routing)
|
|
17
10
|
require_relative "../../app/controllers/findbug/application_controller"
|
|
18
11
|
require_relative "../../app/controllers/findbug/dashboard_controller"
|
data/lib/findbug/railtie.rb
CHANGED
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require "rails/railtie"
|
|
4
4
|
|
|
5
|
-
# Load the engine early so models are available for multi-tenant gems (Apartment)
|
|
6
|
-
# that resolve excluded_models during boot via Object.const_get.
|
|
7
|
-
require_relative "engine"
|
|
8
|
-
|
|
9
5
|
module Findbug
|
|
10
6
|
# Railtie hooks Findbug into the Rails boot process.
|
|
11
7
|
#
|
|
@@ -54,6 +50,18 @@ module Findbug
|
|
|
54
50
|
# - All models to be loaded
|
|
55
51
|
#
|
|
56
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
|
+
|
|
57
65
|
# Register our middleware to catch exceptions
|
|
58
66
|
#
|
|
59
67
|
# MIDDLEWARE ORDER MATTERS!
|
|
@@ -121,7 +129,7 @@ module Findbug
|
|
|
121
129
|
app.config.after_initialize do
|
|
122
130
|
next unless Findbug.config.web_enabled?
|
|
123
131
|
|
|
124
|
-
|
|
132
|
+
require_relative "engine"
|
|
125
133
|
|
|
126
134
|
# Add routes programmatically
|
|
127
135
|
# This is equivalent to `mount Findbug::Engine => "/findbug"` in routes.rb
|
data/lib/findbug/version.rb
CHANGED