Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcmrd Senya <senya@riseup.net>2016-07-19 14:02:46 +0300
committercmrd Senya <senya@riseup.net>2016-08-08 17:22:30 +0300
commit94ce3834986d354582127e7b0bc134362baae07a (patch)
tree012b0efa6cc0ee5bdeb9be27638b1b265abc40c4 /app/controllers
parenta3f208c38031ee69e20af5cfcb86657bdfc95d27 (diff)
Introduce NotificationSerializer
And remove the note_html property from the model.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/notifications_controller.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb
index 984a381e7..7ddb9b8d6 100644
--- a/app/controllers/notifications_controller.rb
+++ b/app/controllers/notifications_controller.rb
@@ -52,13 +52,16 @@ class NotificationsController < ApplicationController
format.html
format.xml { render :xml => @notifications.to_xml }
format.json {
- @notifications.each do |note|
- note.note_html = render_to_string(partial: "notification", locals: {note: note, no_aspect_dropdown: true})
- end
- render json: @notifications.to_json
+ render json: @notifications, each_serializer: NotificationSerializer
}
end
+ end
+ def default_serializer_options
+ {
+ context: self,
+ root: false
+ }
end
def read_all