Sha256: cfdd0aa7358bdb8fdcb953b8f487e3a2e84aefe236b5d1f852858b068f42ef58
Contents?: true
Size: 729 Bytes
Versions: 11
Compression:
Stored size: 729 Bytes
Contents
module NotificationHandler module Target def self.included base base.extend ClassMethods end module ClassMethods def notification_target has_many :notifications, as: :target, dependent: :destroy include NotificationHandler::Target::InstanceMethods include NotificationSettings::Target if defined?(NotificationSettings) include NotificationSettings::Subscriber if defined?(NotificationSettings) end end module InstanceMethods def notify options = {} self.notifications.create options end end end end
Version data entries
11 entries across 11 versions & 1 rubygems