Skip to content

Commit 434cfb3

Browse files
authored
fix: Fixes various Hound issues for 2.0 (#370)
* fix: Fixes Hound issues (1/6) * fix: Additional Hound issues
1 parent a9e14f5 commit 434cfb3

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

app/controllers/rsvps_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def update
6565
bus_after_rsvp = @questionnaire.bus_list_id
6666
acc_status_after_rsvp = @questionnaire.acc_status
6767

68-
if bus != nil && (acc_status != acc_status_after_rsvp || bus != bus_after_rsvp) && @questionnaire.is_bus_captain == true
68+
if !bus.nil? && (acc_status != acc_status_after_rsvp || bus != bus_after_rsvp) && @questionnaire.is_bus_captain == true
6969
@questionnaire.is_bus_captain = false
7070
directors = User.where(role: :director)
7171
directors.each do |user|

db/migrate/20200525234832_move_user_info_from_questionnaire_to_user_model.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
class MoveUserInfoFromQuestionnaireToUserModel < ActiveRecord::Migration[5.2]
2-
32
# See the "Hackathon Manager 2.0 Migration Guide"
43
# for a more general description of what this migration does.
54

65
# Effectively, we move the `first_name` and `last_name` columns
76
# from the questionnares table to the users table (and model, for both).
87

98
def up
10-
119
# Add the first/last name columns to the users table
1210
add_column :users, :first_name, :string
1311
add_column :users, :last_name, :string
@@ -26,7 +24,7 @@ def up
2624
email_head = u.email.partition('@').first
2725
u.first_name = email_head
2826
u.last_name = email_head
29-
u.save()
27+
u.save
3028
end
3129

3230
# Remove the first/last name columns from the questionnaires table
@@ -35,7 +33,6 @@ def up
3533
end
3634

3735
def down
38-
3936
# Add the first/last name columns back to the questionnaires table
4037
add_column :questionnaires, :first_name, :string
4138
add_column :questionnaires, :last_name, :string
@@ -48,7 +45,7 @@ def down
4845
# and set both their first/last name to nil.
4946
User.all.each do |u|
5047
email_head = u.email.partition('@').first
51-
if u.first_name == email_head and u.last_name == email_head
48+
if u.first_name == email_head && u.last_name == email_head
5249
u.first_name = nil
5350
u.last_name = nil
5451
end

0 commit comments

Comments
 (0)