From 6328c7d438e82316949e51c9a7d7f6284224dcb8 Mon Sep 17 00:00:00 2001 From: "Chris Baudouin, Jr" Date: Mon, 21 Sep 2020 01:15:10 -0400 Subject: [PATCH 1/2] fix: Fixes Hound issues (1/6) --- app/controllers/rsvps_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/rsvps_controller.rb b/app/controllers/rsvps_controller.rb index 85a61defd..708b77c11 100644 --- a/app/controllers/rsvps_controller.rb +++ b/app/controllers/rsvps_controller.rb @@ -65,7 +65,7 @@ def update bus_after_rsvp = @questionnaire.bus_list_id acc_status_after_rsvp = @questionnaire.acc_status - if bus != nil && (acc_status != acc_status_after_rsvp || bus != bus_after_rsvp) && @questionnaire.is_bus_captain == true + if !bus.nil? && (acc_status != acc_status_after_rsvp || bus != bus_after_rsvp) && @questionnaire.is_bus_captain == true @questionnaire.is_bus_captain = false directors = User.where(role: :director) directors.each do |user| From 82bb357bd808aa4b061b0e58ae7b43ac6bf9811b Mon Sep 17 00:00:00 2001 From: "Chris Baudouin, Jr" Date: Mon, 21 Sep 2020 01:17:44 -0400 Subject: [PATCH 2/2] fix: Additional Hound issues --- ...4832_move_user_info_from_questionnaire_to_user_model.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/db/migrate/20200525234832_move_user_info_from_questionnaire_to_user_model.rb b/db/migrate/20200525234832_move_user_info_from_questionnaire_to_user_model.rb index 7079ad37b..665ad34c5 100644 --- a/db/migrate/20200525234832_move_user_info_from_questionnaire_to_user_model.rb +++ b/db/migrate/20200525234832_move_user_info_from_questionnaire_to_user_model.rb @@ -1,5 +1,4 @@ class MoveUserInfoFromQuestionnaireToUserModel < ActiveRecord::Migration[5.2] - # See the "Hackathon Manager 2.0 Migration Guide" # for a more general description of what this migration does. @@ -7,7 +6,6 @@ class MoveUserInfoFromQuestionnaireToUserModel < ActiveRecord::Migration[5.2] # from the questionnares table to the users table (and model, for both). def up - # Add the first/last name columns to the users table add_column :users, :first_name, :string add_column :users, :last_name, :string @@ -26,7 +24,7 @@ def up email_head = u.email.partition('@').first u.first_name = email_head u.last_name = email_head - u.save() + u.save end # Remove the first/last name columns from the questionnaires table @@ -35,7 +33,6 @@ def up end def down - # Add the first/last name columns back to the questionnaires table add_column :questionnaires, :first_name, :string add_column :questionnaires, :last_name, :string @@ -48,7 +45,7 @@ def down # and set both their first/last name to nil. User.all.each do |u| email_head = u.email.partition('@').first - if u.first_name == email_head and u.last_name == email_head + if u.first_name == email_head && u.last_name == email_head u.first_name = nil u.last_name = nil end