Class: Notification

Inherits:
Ekylibre::Record::Base show all
Defined in:
app/models/notification.rb

Overview

Column message expect a string which is more an ID. It permits to be i18nized. Notifications are used to inform users asynchronously.

Instance Method Summary collapse

Methods inherited from Ekylibre::Record::Base

#already_updated?, #check_if_destroyable?, #check_if_updateable?, columns_definition, #customizable?, customizable?, #customized?, #destroyable?, #editable?, has_picture, #human_attribute_name, nomenclature_reflections, #old_record, #others, refers_to, #unsuppress, #updateable?

Methods included from Userstamp::Stampable

included

Methods included from Userstamp::Stamper

included

Instance Method Details

#human_messageObject


58
59
60
# File 'app/models/notification.rb', line 58

def human_message
  "notifications.messages.#{message}".t(interpolations.symbolize_keys.merge(default: message.humanize))
end

#read!Object

]VALIDATORS]


54
55
56
# File 'app/models/notification.rb', line 54

def read!
  update_attributes!(read_at: Time.zone.now)
end