Sha256: 0cfdf0737cd2553fc36aad8750771fae3168256ad04af18241a60ef446d0d6d1
Contents?: true
Size: 872 Bytes
Versions: 21
Compression:
Stored size: 872 Bytes
Contents
# frozen_string_literal: true module ForemanDiscovery module UINotifications # Adds notification upon newly discovered Hosts # This class will only create one notification for newly discovered Hosts # and will update notification expiry when new discovered hosts appear. class NewHost < ::UINotifications::Base private def create add_notification if update_notifications.zero? end def update_notifications blueprint.mass_update_expiry end def add_notification Notification.create!( initiator: initiator, audience: ::Notification::AUDIENCE_SUBJECT, subject: subject, notification_blueprint: blueprint ) end def blueprint @blueprint ||= NotificationBlueprint.find_by(name: 'new_discovered_host') end end end end
Version data entries
21 entries across 21 versions & 1 rubygems