Skip to content

Commit

Permalink
Use helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-illi committed Dec 4, 2023
1 parent 681f49b commit 563bdf6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/controllers/youth/event/register_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module Youth::Event::RegisterController
extend ActiveSupport::Concern

included do
helper_method :manager
helper_method :manager, :feature_enabled?

alias_method_chain :registered_notice, :manager
alias_method_chain :contact_data_class, :manager
Expand All @@ -33,6 +33,7 @@ def contact_data_class_with_manager
end

def feature_enabled?
FeatureGate.enabled?('people.people_managers.self_service_managed_creation')
FeatureGate.enabled?('people.people_managers') &&
FeatureGate.enabled?('people.people_managers.self_service_managed_creation')
end
end
2 changes: 1 addition & 1 deletion app/views/event/register/_email_check.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
= f.honeypot(:verification)
= f.indented do
= submit_button(f, t('.next'))
- if FeatureGate.enabled?('people.people_managers') && FeatureGate.enabled?('people.people_managers.self_service_managed_creation')
- if feature_enabled?
= submit_button(f, t('.next_for_manager'), formaction: register_group_event_path(group, event, manager: true))

0 comments on commit 563bdf6

Please sign in to comment.