Sha256: fb01c2c0e1a5ab60748f4748143a559640d8ce5e29548e03903696117b259b8f

Contents?: true

Size: 572 Bytes

Versions: 8

Compression:

Stored size: 572 Bytes

Contents

module Wupee
  module Receiver
    extend ActiveSupport::Concern

    included do
      has_many :notifications, as: :receiver, dependent: :destroy, class_name: "Wupee::Notification"
      has_many :notification_type_configurations, as: :receiver, dependent: :destroy, class_name: "Wupee::NotificationTypeConfiguration"

      after_create do
        Wupee::NotificationType.pluck(:id).each do |notification_type_id|
          Wupee::NotificationTypeConfiguration.create!(notification_type_id: notification_type_id, receiver: self)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
wupee-1.1.4 app/models/concerns/wupee/receiver.rb
wupee-1.1.3 app/models/concerns/wupee/receiver.rb
wupee-1.1.2 app/models/concerns/wupee/receiver.rb
wupee-1.0.4 app/models/concerns/wupee/receiver.rb
wupee-1.0.3 app/models/concerns/wupee/receiver.rb
wupee-1.0.2 app/models/concerns/wupee/receiver.rb
wupee-1.0.1 app/models/concerns/wupee/receiver.rb
wupee-1.0.0 app/models/concerns/wupee/receiver.rb