Sha256: a8bbf3aed5333e5aacb376e3773ab6fd4ec8a68046d023c7216aa1f8a6a2815f
Contents?: true
Size: 909 Bytes
Versions: 36
Compression:
Stored size: 909 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 end def update_notifications blueprint.mass_update_expiry end def add_notification Notification.create!( initiator: initiator, audience: ::Notification::AUDIENCE_SUBJECT, message: _("Host %s has been dicovered") % subject.name, subject: subject, notification_blueprint: blueprint ) end def blueprint @blueprint ||= NotificationBlueprint.find_by(name: 'new_discovered_host') end end end end
Version data entries
36 entries across 36 versions & 1 rubygems