Sha256: 5df276812abf553793290a90611607d4dab4977a4fd43c611731874fa41f2eb4
Contents?: true
Size: 727 Bytes
Versions: 2
Compression:
Stored size: 727 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 extend NotificationSettings::Target if defined?(NotificationSettings) extend NotificationSettings::Subscriber if defined?(NotificationSettings) end end module InstanceMethods def notify options = {} self.notifications.create options end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
notification-handler-1.0.0.beta10 | lib/notification_handler/target.rb |
notification-handler-1.0.0.beta9 | lib/notification_handler/target.rb |