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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c29bc5c8718f46a269d9987839af57928d7aab2c0b3451f08edd4683729f381
4
- data.tar.gz: fd9771ef2dee52d0b50fa1b5226c401b15ce85e3c4481e15684907d5756b83db
3
+ metadata.gz: 616e1bc054f2658af793f1c309250e0037430bdf162b2593d6c6506426116a40
4
+ data.tar.gz: d19ed012c13b738227a25b05aef496e2a6ad9a67e79e68b5eb13a98415dd52ad
5
5
  SHA512:
6
- metadata.gz: '018370d27b3517272c7ecf1c1f392c2d3abbcd54b92d223227ad200f39232f534a0ecc875fc79019bad2bf7e48fdbe9b81ac51326fdfdc9854fa6da2f8c9149d'
7
- data.tar.gz: 64bb0554fd369ed717dd17b3c05fdfc7ae5fb275c461491ee85a19dcae91938e07e371941bc21940def52d69426f2d1bc6397300a365b3d1782555642ed18387
6
+ metadata.gz: cf42ad84ee1a74b468acf35648c096c1ecdcd56d1ffa529b87e0c6626fcfa46f129ac7d14d1852fd38dcbbae37e9282a5b6efdbb2e79be808aa95927671c35ff
7
+ data.tar.gz: 360185e9086ce255b0764cd15821cf2de5c46ffcb4a3863185fcb31f16c8efd27572eb61b7d080c607dd14462a87a61dd20103416b60fa81db14b95443c56e65
@@ -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).
@@ -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!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Findbug
4
- VERSION = "0.3.1"
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.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soumit Das