-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add env variable feature flag for early years emails
- Loading branch information
1 parent
96498b0
commit 26c6474
Showing
10 changed files
with
71 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module Users | ||
class EarlyYearsEmailsForm < BaseForm | ||
attr_accessor :early_years_emails | ||
|
||
validates :early_years_emails, presence: true | ||
|
||
def name | ||
'early_years_emails' | ||
end | ||
|
||
def save | ||
if valid? | ||
user.update!( | ||
early_years_emails: early_years_emails, | ||
) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
= govuk_back_link= govuk_back_link href: edit_registration_training_emails_path | ||
.govuk-grid-row | ||
.govuk-grid-column-full | ||
= form_for @user_form, url: registration_early_years_emails_path, method: :patch do |f| | ||
= f.govuk_error_summary | ||
= f.govuk_collection_radio_buttons :early_years_emails, | ||
[OpenStruct.new(id: true, name: t('.opt_in')),OpenStruct.new(id: false, name: t('.opt_out'))], | ||
:id, | ||
:name, | ||
legend: { text: t('.heading') }, | ||
hint: { text: translate_markdown(t('.body')) } | ||
|
||
div class='govuk-!-margin-top-4' | ||
= f.govuk_submit t('.button') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
db/migrate/20230707093631_remove_early_years_email_preferences_from_users.rb
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters