summaryrefslogtreecommitdiff
path: root/app/models/concerns/notification_branch_selection.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/concerns/notification_branch_selection.rb')
-rw-r--r--app/models/concerns/notification_branch_selection.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/app/models/concerns/notification_branch_selection.rb b/app/models/concerns/notification_branch_selection.rb
index 7f00b652530..2354335469a 100644
--- a/app/models/concerns/notification_branch_selection.rb
+++ b/app/models/concerns/notification_branch_selection.rb
@@ -6,12 +6,14 @@
module NotificationBranchSelection
extend ActiveSupport::Concern
- BRANCH_CHOICES = [
- [_('All branches'), 'all'],
- [_('Default branch'), 'default'],
- [_('Protected branches'), 'protected'],
- [_('Default branch and protected branches'), 'default_and_protected']
- ].freeze
+ def branch_choices
+ [
+ [_('All branches'), 'all'].freeze,
+ [_('Default branch'), 'default'].freeze,
+ [_('Protected branches'), 'protected'].freeze,
+ [_('Default branch and protected branches'), 'default_and_protected'].freeze
+ ].freeze
+ end
def notify_for_branch?(data)
ref = if data[:ref]