From 2425d0ecfce300671c038b631f32a591ece55051 Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 23 May 2023 11:15:59 +0200 Subject: [PATCH 1/2] Remove unused code In the commit: 315c57929a this code was added, but at that time this field was no longer in use, even though it existed in the database. I don't know why this line was added, but there seems to be no point in keeping it. --- app/controllers/management/users_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/management/users_controller.rb b/app/controllers/management/users_controller.rb index 43f23f40e..786f7b890 100644 --- a/app/controllers/management/users_controller.rb +++ b/app/controllers/management/users_controller.rb @@ -59,7 +59,6 @@ class Management::UsersController < Management::BaseController @user.confirmed_at = Time.current @user.newsletter = false - @user.email_on_proposal_notification = false @user.email_digest = false @user.email_on_direct_message = false @user.email_on_comment = false From 0d937647af635beb9aace0f56cb1b27e54e877e8 Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 23 May 2023 11:11:24 +0200 Subject: [PATCH 2/2] Remove the unused field from the database. In the PR #1140 this field was added in commit ad697cd2c1, but in this same PR in commit 28d12fe55 all the related functionality that had been added was removed but the field was not removed. --- ...90028_remove_email_on_proposal_notification_from_users.rb | 5 +++++ db/schema.rb | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20230523090028_remove_email_on_proposal_notification_from_users.rb diff --git a/db/migrate/20230523090028_remove_email_on_proposal_notification_from_users.rb b/db/migrate/20230523090028_remove_email_on_proposal_notification_from_users.rb new file mode 100644 index 000000000..8d855b38c --- /dev/null +++ b/db/migrate/20230523090028_remove_email_on_proposal_notification_from_users.rb @@ -0,0 +1,5 @@ +class RemoveEmailOnProposalNotificationFromUsers < ActiveRecord::Migration[6.0] + def change + remove_column :users, :email_on_proposal_notification, :boolean, default: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 802fe82b0..75b8d5713 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2023_02_06_141152) do +ActiveRecord::Schema.define(version: 2023_05_23_090028) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -1630,7 +1630,6 @@ ActiveRecord::Schema.define(version: 2023_02_06_141152) do t.string "redeemable_code" t.string "gender", limit: 10 t.datetime "date_of_birth" - t.boolean "email_on_proposal_notification", default: true t.boolean "email_digest", default: true t.boolean "email_on_direct_message", default: true t.boolean "official_position_badge", default: false