Sha256: 311bd61136fb582c0239e0d36adeb0a4b090e136086342d996c2a49f4bc1ae13

Contents?: true

Size: 703 Bytes

Versions: 3

Compression:

Stored size: 703 Bytes

Contents

module Yodeler
  module ListensToYodler
    extend ActiveSupport::Concern
 
    included do
    end
 
    module ClassMethods
      def listens_to_yodler(subscriptions_assocation_name = :yodeler_subscriptions)
        cattr_accessor :yodeler_subscriptions_name
        self.yodeler_subscriptions_name = subscriptions_assocation_name

        has_many self.yodeler_subscriptions_name, 
          dependent: :destroy, 
          class_name: "Yodeler::Subscription", 
          foreign_key: :subscriber_id
         
        include Yodeler::ListensToYodler::LocalInstanceMethods
      end
    end
 
    module LocalInstanceMethods;end;
  end
end
 
ActiveRecord::Base.send :include, Yodeler::ListensToYodler

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yodeler-0.0.4 lib/yodeler/listens_to_yodler.rb
yodeler-0.0.3 lib/yodeler/listens_to_yodler.rb
yodeler-0.0.1 lib/yodeler/listens_to_yodler.rb