Skip to content

Commit

Permalink
Add in Prosopite n+1 checker
Browse files Browse the repository at this point in the history
  • Loading branch information
fiveNinePlusR committed Oct 12, 2024
1 parent 73bfb9e commit f74b461
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ group :development, :test do
gem 'email_spec'
gem 'listen'
gem 'ostruct' # suppress deprecation warning for pry
gem 'pg_query'
gem 'prosopite'
gem 'pry'
gem 'rails_real_favicon'
end
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ GEM
ffi (~> 1.0)
globalid (1.2.1)
activesupport (>= 6.1)
google-protobuf (4.28.2)
bigdecimal
rake (>= 13)
haml (6.3.0)
temple (>= 0.8.2)
thor
Expand Down Expand Up @@ -303,7 +306,10 @@ GEM
ast (~> 2.4.1)
racc
pg (1.5.8)
pg_query (5.1.0)
google-protobuf (>= 3.22.3)
phonelib (0.9.2)
prosopite (1.4.2)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
Expand Down Expand Up @@ -552,7 +558,9 @@ DEPENDENCIES
paper_trail
paper_trail-association_tracking
pg
pg_query
phonelib
prosopite
pry
puma
rack
Expand Down
4 changes: 4 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,8 @@
Bullet.rails_logger = true
Bullet.add_footer = true
end

config.after_initialize do
Prosopite.rails_logger = true
end
end
6 changes: 6 additions & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,10 @@
# Raise error when a before_action's only/except options reference missing actions.
config.action_controller.raise_on_missing_callback_actions = true


config.after_initialize do
Prosopite.rails_logger = true
Prosopite.raise = true
end

end
4 changes: 4 additions & 0 deletions config/initializers/prosopite.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
unless Rails.env.production?
require 'prosopite/middleware/rack'
Rails.configuration.middleware.use(Prosopite::Middleware::Rack)
end
9 changes: 9 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
require 'simplecov-cobertura'
require 'rspec/retry'
require 'selenium/webdriver'
require 'paper_trail/frameworks/rspec'

include Sprockets::Rails::Helper
include ActiveSupport::Testing::TimeHelpers
Expand Down Expand Up @@ -123,6 +124,14 @@
)
end

config.before(:each) do
Prosopite.scan
end

config.after(:each) do
Prosopite.finish
end

config.before(js: true) do
DatabaseCleaner.strategy = :truncation
end
Expand Down

0 comments on commit f74b461

Please sign in to comment.