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