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 bullet2 #735

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
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
5 changes: 5 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 @@ -523,6 +526,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 +574,7 @@ DEPENDENCIES
bootsnap
bootstrap
browser
bullet
byebug
capybara
cocoon
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/web/admin/vacancies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
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
5 changes: 3 additions & 2 deletions app/controllers/web/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ def index

def show
@user = User.find(params[:id])
@user_resume_answers = @user.resume_answers.web
@user_resume_answers_likes_count = @user.resume_answers.sum('likes_count')
resume_answers = @user.resume_answers
@user_resume_answers = resume_answers.web
@user_resume_answers_likes_count = resume_answers.sum('likes_count')
@user_resumes = @user.resumes.web
@user_resume_comments = @user.resume_comments.web.joins(:resume).merge(Resume.web)
@career_members = @user.career_members.includes(:career, :career_step_members).without_archive_members
Expand Down
10 changes: 10 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# frozen_string_literal: true

Rails.application.configure do
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

config.logger = ActiveSupport::Logger.new($stdout)
# Settings specified here will take precedence over those in config/application.rb.

Expand Down
6 changes: 5 additions & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
# and recreated between test runs. Don't rely on the data there!

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

Expand Down
Loading