Module: Notifications::Model

Extended by:
ActiveSupport::Concern
Included in:
Notification
Defined in:
lib/notifications/model.rb

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

DEFAULT_AVATAR =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAADwCAMAAAAJixmgAAAAFVBMVEWkpKSnp6eqqqq3t7fS0tLV1dXZ2dmshcKEAAAAtklEQVR4Ae3XsRGAAAjAQFRk/5HtqaTz5H+DlInvAQAAAAAAAAAAAAAAAAAAAACymiveO6o7BQsWLFiwYMGCBS8PFixYsGDBggULFixYsGDBggULFixYsGDBggULFixYsGDBc4IFCxYsWLBgwYIFC14ZfOeAPRQ8IliwYMGCBQsWLFiwYMGCBQsWLFiwYMGCBQsWLFiwYMGCBQsWLFiwYMGCBQv+JQAAAAAAAAAAAAAAAAAAAOAB4KJfdHmj+kwAAAAASUVORK5CYII='

Instance Method Summary collapse

Instance Method Details

#actor_avatar_urlObject



29
30
31
32
33
# File 'lib/notifications/model.rb', line 29

def actor_avatar_url
  return DEFAULT_AVATAR if Notifications.config.user_avatar_url_method.blank?
  return DEFAULT_AVATAR if self.actor.blank?
  self.actor.send(Notifications.config.user_avatar_url_method)
end

#actor_nameObject



24
25
26
27
# File 'lib/notifications/model.rb', line 24

def actor_name
  return '' if self.actor.blank?
  self.actor.send(Notifications.config.user_name_method)
end

#actor_profile_urlObject



35
36
37
38
39
# File 'lib/notifications/model.rb', line 35

def actor_profile_url
  return nil if Notifications.config..blank?
  return nil if self.actor.blank?
  self.actor.send(Notifications.config.)
end

#read?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/notifications/model.rb', line 20

def read?
  self.read_at.present?
end