demarches-normaliennes/app/models/notification.rb

21 lines
615 B
Ruby
Raw Normal View History

2016-12-21 17:26:31 +01:00
class Notification < ActiveRecord::Base
belongs_to :dossier
2017-02-21 16:49:32 +01:00
serialize :liste if Rails.env.test?
2016-12-21 17:26:31 +01:00
2016-12-26 11:33:12 +01:00
# after_save :broadcast_notification
enum type_notif: {
2016-12-26 11:33:12 +01:00
commentaire: 'commentaire',
cerfa: 'cerfa',
2016-12-26 11:47:51 +01:00
piece_justificative: 'piece_justificative',
2016-12-26 11:57:08 +01:00
champs: 'champs',
submitted: 'submitted'
}
2016-12-26 11:33:12 +01:00
# def broadcast_notification
# ActionCable.server.broadcast 'notifications',
2016-12-27 15:05:19 +01:00
# message: "Dossier n°#{self.dossier.id} : #{self.liste.last}",
# dossier: {id: self.dossier.id}
2016-12-26 11:33:12 +01:00
# end
2016-12-21 17:26:31 +01:00
end