Class: Message

Inherits:
ApplicationRecord show all
Extended by:
Enumerize
Defined in:
app/models/message.rb

Overview

typed: ignore user is polymorphic, it could be [User] or [Owner] content is polymorphic, it could be [Reservation] or [Reward] action_type is action type of a content, it could be create, edit, cancel, redeem, etc title and body is an message that can be sent to user

Instance Method Summary collapse

Methods inherited from ApplicationRecord

sync_carrierwave_url

Instance Method Details



13
14
15
16
17
18
19
20
# File 'app/models/message.rb', line 13

def deep_link
  case content_type
  when "Reservation"
    "app://reservations/#{content_id}"
  when "Reward"
    "app://user/rewards"
  end
end