Module: Integrations::Base::EmailsOnPush
- Extended by:
- ActiveSupport::Concern
- Includes:
- NotificationBranchSelection
- Included in:
- EmailsOnPush
- Defined in:
- app/models/concerns/integrations/base/emails_on_push.rb
Constant Summary collapse
- RECIPIENTS_LIMIT =
750
Instance Method Summary collapse
- #disable_diffs? ⇒ Boolean
- #execute(push_data) ⇒ Object
- #initialize_properties ⇒ Object
- #notify_for_ref?(push_data) ⇒ Boolean
- #send_from_committer_email? ⇒ Boolean
Methods included from NotificationBranchSelection
Instance Method Details
#disable_diffs? ⇒ Boolean
106 107 108 |
# File 'app/models/concerns/integrations/base/emails_on_push.rb', line 106 def disable_diffs? Gitlab::Utils.to_boolean(disable_diffs) end |
#execute(push_data) ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'app/models/concerns/integrations/base/emails_on_push.rb', line 80 def execute(push_data) return unless project return unless supported_events.include?(push_data[:object_kind]) return if project.emails_disabled? return unless notify_for_ref?(push_data) EmailsOnPushWorker.perform_async( project_id, recipients, push_data, send_from_committer_email: send_from_committer_email?, disable_diffs: disable_diffs? ) end |
#initialize_properties ⇒ Object
74 75 76 77 78 |
# File 'app/models/concerns/integrations/base/emails_on_push.rb', line 74 def initialize_properties super self.branches_to_be_notified = 'all' if branches_to_be_notified.nil? end |
#notify_for_ref?(push_data) ⇒ Boolean
95 96 97 98 99 100 |
# File 'app/models/concerns/integrations/base/emails_on_push.rb', line 95 def notify_for_ref?(push_data) return true if push_data[:object_kind] == 'tag_push' return true if push_data.dig(:object_attributes, :tag) notify_for_branch?(push_data) end |