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_url ⇒ Object
27 28 29 30 31 |
# File 'lib/notifications/model.rb', line 27 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_name ⇒ Object
22 23 24 25 |
# File 'lib/notifications/model.rb', line 22 def actor_name return "" if self.actor.blank? self.actor.send(Notifications.config.user_name_method) end |
#actor_profile_url ⇒ Object
33 34 35 36 |
# File 'lib/notifications/model.rb', line 33 def actor_profile_url return '#' if self.actor.blank? self.actor.send(Notifications.config.user_profile_url_method) end |
#read? ⇒ Boolean
18 19 20 |
# File 'lib/notifications/model.rb', line 18 def read? self.read_at.present? end |