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?, attr_readonly_with_conditions, #check_if_destroyable?, #check_if_updateable?, columns_definition, complex_scopes, customizable?, #customizable?, #customized?, #destroyable?, #editable?, has_picture, #human_attribute_name, human_attribute_name_with_id, nomenclature_reflections, #old_record, #others, refers_to, scope_with_registration, simple_scopes, #updateable?

Instance Method Details

#human_messageObject


56
57
58
# File 'app/models/notification.rb', line 56

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

#read!Object

]VALIDATORS]


52
53
54
# File 'app/models/notification.rb', line 52

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