Module: Photon::Delivers

Defined in:
lib/photon/delivers.rb,
lib/photon/delivers/core.rb,
lib/photon/delivers/message.rb

Defined Under Namespace

Modules: Core, Message

Instance Method Summary collapse

Instance Method Details

#acts_as_deliverableObject



13
14
15
16
17
18
19
20
# File 'lib/photon/delivers.rb', line 13

def acts_as_deliverable
  class_eval do
    belongs_to Photon.to.to_s.singularize.to_sym
    belongs_to Photon.using.to_s.singularize.to_sym
    belongs_to Photon.thread.to_s.singularize.to_sym

  end
end

#acts_as_messageObject



22
23
24
25
26
27
28
29
30
# File 'lib/photon/delivers.rb', line 22

def acts_as_message
  class_eval do
    has_many Photon.through
    has_many Photon.to, :through => Photon.through
    belongs_to :sender, :class_name => Photon.to.to_s.singularize.classify

    include Photon::Delivers::Message
  end
end

#acts_as_senderObject



3
4
5
6
7
8
9
10
11
# File 'lib/photon/delivers.rb', line 3

def acts_as_sender
  class_eval do

    has_many Photon.through
    has_many Photon.using, :through => Photon.through

    include Photon::Delivers::Core
  end
end

#acts_as_threadableObject



32
33
34
35
36
# File 'lib/photon/delivers.rb', line 32

def acts_as_threadable
  class_eval do
    has_many Photon.through
  end
end