Class: Msg::Envelope

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/msg/envelope.rb

Instance Method Summary collapse

Instance Method Details

#messageObject



17
18
19
# File 'app/models/msg/envelope.rb', line 17

def message
  sending.message
end

#open!Object



21
22
23
# File 'app/models/msg/envelope.rb', line 21

def open!
  update_column(:opened_at, Time.now)
end

#statusObject



25
26
27
28
29
30
31
32
33
# File 'app/models/msg/envelope.rb', line 25

def status
  if opened_at?
    "read"
  elsif bounces.any?
    "bounced"
  else
    "unread"
  end
end