Skip to content

Commit

Permalink
Set to eager_loading when rails eager_load! called
Browse files Browse the repository at this point in the history
  • Loading branch information
kbaum committed Apr 27, 2019
1 parent 64e038f commit 1181516
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/coverband/utils/railtie.rb
Expand Up @@ -2,6 +2,18 @@

Coverband.eager_loading_coverage!
module Coverband
module RailsEagerLoad
def eager_load!
Coverband.configuration.logger&.debug('Coverband: set to eager_loading')
Coverband.eager_loading_coverage!
super
ensure
Coverband.report_coverage(true)
Coverband.runtime_coverage!
end
end
Rails::Engine.prepend(RailsEagerLoad)

class Railtie < Rails::Railtie
initializer 'coverband.configure' do |app|
app.middleware.use Coverband::Middleware
Expand Down

0 comments on commit 1181516

Please sign in to comment.