Sha256: 12c8c1ff94a811bc9894891a56db8e5b7b651bbbdc56bbf46275d6afad7d349d
Contents?: true
Size: 812 Bytes
Versions: 9
Compression:
Stored size: 812 Bytes
Contents
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_ADMIN, notification_blueprint: blueprint ) end def blueprint @blueprint ||= NotificationBlueprint.find_by(name: 'new_discovered_host') end end end end
Version data entries
9 entries across 9 versions & 1 rubygems