Use userfield serializer in json dump

Use userfield serializer for json dump to make sure
that also the options are serialized correctly.
This commit is contained in:
Jonathan Brachthaeuser 2015-08-17 21:44:08 +02:00
parent 7eb32be4de
commit fc2fe5f02d

View file

@ -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