Class: NotificationSerializer

Inherits:
ActiveModel::Serializer
  • Object
show all
Defined in:
app/serializers/notification_serializer.rb

Instance Method Summary collapse

Constructor Details

#initialize(*_) ⇒ NotificationSerializer

Returns a new instance of NotificationSerializer.


17
18
19
20
21
# File 'app/serializers/notification_serializer.rb', line 17

def initialize(*_)
  super
  self.polymorphic = true
  self.root = false
end

Instance Method Details

#note_htmlObject


13
14
15
# File 'app/serializers/notification_serializer.rb', line 13

def note_html
  context.render_to_string(partial: "notifications/notification", locals: {note: object, no_aspect_dropdown: true})
end