From fc2fe5f02d83a277b9403472cd0fa9bd40e56bc1 Mon Sep 17 00:00:00 2001 From: Jonathan Brachthaeuser Date: Mon, 17 Aug 2015 21:44:08 +0200 Subject: [PATCH] Use userfield serializer in json dump Use userfield serializer for json dump to make sure that also the options are serialized correctly. --- app/models/site.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/site.rb b/app/models/site.rb index 4d3c1590515..719cf1d7123 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -80,7 +80,9 @@ class Site return { periods: TopTopic.periods.map(&:to_s), filters: Discourse.filters.map(&:to_s), - user_fields: UserField.all + user_fields: UserField.all.map do |userfield| + UserFieldSerializer.new(userfield, root: false, scope: guardian) + end }.to_json end