From 7b5951d636bfe34131164898c2ce2a0beaf5d7ea Mon Sep 17 00:00:00 2001 From: jonathan Date: Fri, 20 Dec 2024 16:56:31 -0500 Subject: [PATCH 1/2] Create dietary restrictions column This change will add a column to the Member model, allowing users to provide dietary information. This should support Codebar hosts to provide good food options for all attendees --- .../20241220215044_add_dietary_restrictions_to_member.rb | 5 +++++ db/schema.rb | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20241220215044_add_dietary_restrictions_to_member.rb diff --git a/db/migrate/20241220215044_add_dietary_restrictions_to_member.rb b/db/migrate/20241220215044_add_dietary_restrictions_to_member.rb new file mode 100644 index 000000000..4c4c27553 --- /dev/null +++ b/db/migrate/20241220215044_add_dietary_restrictions_to_member.rb @@ -0,0 +1,5 @@ +class AddDietaryRestrictionsToMember < ActiveRecord::Migration[7.0] + def change + add_column :members, :dietary_restrictions, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 90bc0c5b7..cce440dc8 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[7.0].define(version: 2023_12_30_162506) do +ActiveRecord::Schema[7.0].define(version: 2024_12_20_215044) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -394,6 +394,7 @@ t.string "pronouns" t.datetime "accepted_toc_at", precision: nil t.datetime "opt_in_newsletter_at", precision: nil + t.string "dietary_restrictions" t.index ["email"], name: "index_members_on_email", unique: true end From 2c2a167f38bcfdb2276f838a9d41b52bedbc7f87 Mon Sep 17 00:00:00 2001 From: jonathan Date: Fri, 20 Dec 2024 17:02:55 -0500 Subject: [PATCH 2/2] Add input to form This change adds a simple input to the form that collects Member information. I've included a translation in English and in French, because that happens to be another language I speak! --- app/views/member/details/edit.html.haml | 1 + config/locales/en.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/app/views/member/details/edit.html.haml b/app/views/member/details/edit.html.haml index 60bc0fbec..8be2f4a28 100644 --- a/app/views/member/details/edit.html.haml +++ b/app/views/member/details/edit.html.haml @@ -11,6 +11,7 @@ = f.input :surname, required: true = f.input :pronouns = f.input :email, required: true + = f.input :dietary_restrictions, label: t('member.details.edit.dietary_restrictions') - if @member.coach? = f.input :about_you, as: :text, label: t('member.details.edit.coach.about_you'), input_html: { rows: 3 }, required: true - else diff --git a/config/locales/en.yml b/config/locales/en.yml index 966f2a536..5c3cc0181 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -445,6 +445,7 @@ en: edit: title: Almost there... summary: We need some more details from you to finish creating your account. We use these to help run our events. + dietary_restrictions: If you have dietary restrictions, please add them here coach: about_you: What experience do you have? What languages do you like to use? Tell us a little bit about yourself! student: