Sha256: 8f894c05b3387ed0245ede85e65d575e1a97a256a283136ed426ad818b89ffb6

Contents?: true

Size: 463 Bytes

Versions: 5

Compression:

Stored size: 463 Bytes

Contents

module MailyHerald
  module ModelExtensions
    def self.included(base)
      unloadable
      base.class_eval do
        has_many    :maily_herald_subscriptions,       as: :entity, class_name: "MailyHerald::Subscription", dependent: :destroy
        has_many    :maily_herald_logs,                as: :entity, class_name: "MailyHerald::Log"

        after_destroy do
          self.maily_herald_logs.scheduled.destroy_all
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
maily_herald-0.9.4 lib/maily_herald/model_extensions.rb
maily_herald-0.9.3 lib/maily_herald/model_extensions.rb
maily_herald-0.9.2 lib/maily_herald/model_extensions.rb
maily_herald-0.9.1 lib/maily_herald/model_extensions.rb
maily_herald-0.8.0 lib/maily_herald/model_extensions.rb