Skip to content
Merged
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 app/controllers/profiles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class ProfilesController < ApplicationController

def index
@profiles = @competition.profiles.published
.where("#{User.table_name}.deactivated_at is null")
.where.not(identifier: [nil, ''])
.preload(:user)
.includes(:skills)
Expand Down
1 change: 1 addition & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# current_sign_in_at :datetime
# current_sign_in_ip :inet
# data_cruncher :boolean default(FALSE)
# deactivated_at :datetime
# dietary_requirements :text
# email :string default(""), not null
# encrypted_password :string default(""), not null
Expand Down
8 changes: 8 additions & 0 deletions db/migrate/20250822200000_add_deactivated_at_to_user.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class AddDeactivatedAtToUser < ActiveRecord::Migration[7.0]
def up
add_column :users, :deactivated_at, :datetime
end
def down
remove_column :users, :deactivated_at
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2022_07_11_130633) do
ActiveRecord::Schema[7.0].define(version: 2025_08_22_200000) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

Expand Down Expand Up @@ -523,6 +523,7 @@
t.boolean "under_18"
t.integer "region"
t.integer "acting_on_behalf_of_id"
t.datetime "deactivated_at"
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["region"], name: "index_users_on_region"
Expand Down
1 change: 1 addition & 0 deletions spec/factories/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# current_sign_in_at :datetime
# current_sign_in_ip :inet
# data_cruncher :boolean default(FALSE)
# deactivated_at :datetime
# dietary_requirements :text
# email :string default(""), not null
# encrypted_password :string default(""), not null
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# current_sign_in_at :datetime
# current_sign_in_ip :inet
# data_cruncher :boolean default(FALSE)
# deactivated_at :datetime
# dietary_requirements :text
# email :string default(""), not null
# encrypted_password :string default(""), not null
Expand Down
1 change: 1 addition & 0 deletions test/models/user_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# current_sign_in_at :datetime
# current_sign_in_ip :inet
# data_cruncher :boolean default(FALSE)
# deactivated_at :datetime
# dietary_requirements :text
# email :string default(""), not null
# encrypted_password :string default(""), not null
Expand Down
Loading