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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6be157fb43d73577d48e404ce60565bb9673318fb35c00591a4cd070890793d
4
- data.tar.gz: 2ab1e58a35a8a02997f1f56427d8a62bdce9d99b45270bdcfe1c7529e492081e
3
+ metadata.gz: 616e1bc054f2658af793f1c309250e0037430bdf162b2593d6c6506426116a40
4
+ data.tar.gz: d19ed012c13b738227a25b05aef496e2a6ad9a67e79e68b5eb13a98415dd52ad
5
5
  SHA512:
6
- metadata.gz: b8ed796ca72ce63cce24145fb2654f234b7e8d0c3391405d5ab110473f456f5df849f121503d6e33c25e3e538da3f06194baf82a3d9994a132afa7c01c6ac790
7
- data.tar.gz: 28e59dc8442a8a88498e709e575bc2a561d02b44455d729136f8bc50e06340a77a274c4de119611d00788f6b5dc11140fc3b0a91a2c1abf4b83fac00a1916c58
6
+ metadata.gz: cf42ad84ee1a74b468acf35648c096c1ecdcd56d1ffa529b87e0c6626fcfa46f129ac7d14d1852fd38dcbbae37e9282a5b6efdbb2e79be808aa95927671c35ff
7
+ data.tar.gz: 360185e9086ce255b0764cd15821cf2de5c46ffcb4a3863185fcb31f16c8efd27572eb61b7d080c607dd14462a87a61dd20103416b60fa81db14b95443c56e65
@@ -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"
@@ -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
- # Engine is already loaded at top of railtie.rb for Apartment compatibility
132
+ require_relative "engine"
125
133
 
126
134
  # Add routes programmatically
127
135
  # This is equivalent to `mount Findbug::Engine => "/findbug"` in routes.rb
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Findbug
4
- VERSION = "0.3.2"
4
+ VERSION = "0.3.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: findbug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soumit Das