From 8ca83bed5ddc7f3408d90c5e79a427cce0d018af Mon Sep 17 00:00:00 2001 From: olegphenomenon Date: Mon, 18 Oct 2021 15:20:45 +0300 Subject: [PATCH] refactored test --- app/controllers/users/sessions_controller.rb | 8 ++++++-- config/initializers/rails_admin.rb | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/controllers/users/sessions_controller.rb b/app/controllers/users/sessions_controller.rb index 00bde7e8..fd09494a 100644 --- a/app/controllers/users/sessions_controller.rb +++ b/app/controllers/users/sessions_controller.rb @@ -51,11 +51,14 @@ def checking_username(result) user = User.find_by(username: username) initialize_сache_values - generate_quizzes(user) - if user.present? + p "+++++++++" + p user.present? + p user + if user.present? + generate_quizzes(user) sign_in user else new_user = User.create!( @@ -64,6 +67,7 @@ def checking_username(result) superadmin_role: false, ) + generate_quizzes(new_user) sign_in new_user Rails.logger.info "#{new_user.username} sign in" end diff --git a/config/initializers/rails_admin.rb b/config/initializers/rails_admin.rb index a8166a01..36539b60 100644 --- a/config/initializers/rails_admin.rb +++ b/config/initializers/rails_admin.rb @@ -45,6 +45,10 @@ def custom_label_method visible false end + config.model 'AnswerQuestion' do + visible false + end + config.model 'Question' do # object_label_method do # :custom_label_method