Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add bullet #731

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ group :development, :staging, :test do
end

group :development, :test do
gem 'bullet'
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: %i[mri mingw x64_mingw]
# Use sqlite3 as the database for Active Record
Expand Down
6 changes: 6 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ GEM
popper_js (>= 2.11.8, < 3)
browser (5.3.1)
builder (3.2.4)
bullet (7.1.6)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
capybara (3.40.0)
addressable
Expand Down Expand Up @@ -280,6 +283,7 @@ GEM
net-smtp (0.4.0.1)
net-protocol
nio4r (2.7.0)
racc (~> 1.4)
nokogiri (1.16.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.2-x86_64-darwin)
Expand Down Expand Up @@ -523,6 +527,7 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
uniform_notifier (1.16.0)
uri (0.13.0)
valid_email2 (5.2.1)
activemodel (>= 3.2)
Expand Down Expand Up @@ -570,6 +575,7 @@ DEPENDENCIES
bootsnap
bootstrap
browser
bullet
byebug
capybara
cocoon
Expand Down
7 changes: 3 additions & 4 deletions app/controllers/web/admin/vacancies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
class Web::Admin::VacanciesController < Web::Admin::ApplicationController
def index
query = query_params({ s: 'created_at desc' })
scope = Vacancy.includes(:creator).with_locale
@q = scope.ransack(query)
respond_to do |format|
format.html do
@go_to = admin_vacancies_path(page: params[:page])
@q = Vacancy.with_locale.ransack(query)
@vacancies = @q.result(distinct: true).page(params[:page])
end

format.csv do
q = Vacancy.with_locale.includes(:creator).ransack(query)
vacancies = q.result(distinct: true)
vacancies = @q.result(distinct: true)

headers = %w[id title state creator company_name created_at published_at]
send_file_headers!(filename: "vacancies-#{Time.zone.today}.csv")
Expand Down
10 changes: 10 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@
# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true

config.after_initialize do
Bullet.enable = true
Bullet.alert = false
Bullet.bullet_logger = true
Bullet.console = false
Bullet.rails_logger = true
Bullet.sentry = true
Bullet.add_footer = false
end

# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
Expand Down
6 changes: 6 additions & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

config.after_initialize do
Bullet.enable = true
Bullet.bullet_logger = true
Bullet.raise = true
end

config.cache_classes = false

# Do not eager load code on boot. This avoids loading your whole application
Expand Down
Loading