Skip to content

Commit

Permalink
fix(users): remove blank params from user form
Browse files Browse the repository at this point in the history
  • Loading branch information
wJoenn committed Nov 23, 2023
1 parent e82475e commit 76fe5f0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Procfile.dev
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
web: bin/rails server -p 3000 -b 0.0.0.0
web: bin/rails server -p 3000
css: bin/rails tailwindcss:watch
worker: bundle exec good_job start
5 changes: 4 additions & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ def unlock_achievements
end

def user_params
params.require(:user).permit(:accepted_coc, :aoc_id, :city_id, :entered_hardcore, :event_awareness, :favourite_language, :username)
params
.require(:user)
.permit(:accepted_coc, :aoc_id, :city_id, :entered_hardcore, :event_awareness, :favourite_language, :username)
.compact_blank
end
end
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@
t.bigint "city_id"
t.datetime "created_at", null: false
t.boolean "entered_hardcore", default: false, null: false
t.string "favourite_language"
t.integer "event_awareness"
t.string "favourite_language"
t.string "github_username"
t.string "private_leaderboard"
t.string "provider"
Expand Down

0 comments on commit 76fe5f0

Please sign in to comment.