]> git.openstreetmap.org Git - rails.git/commitdiff
Added root elements and dict support for preferences response
authorMichal Migurski <migurski@fb.com>
Thu, 8 Apr 2021 00:41:44 +0000 (17:41 -0700)
committerMichal Migurski <migurski@fb.com>
Thu, 8 Apr 2021 00:45:24 +0000 (17:45 -0700)
app/views/api/user_preferences/_user_preference.json.jbuilder [deleted file]
app/views/api/user_preferences/index.json.jbuilder

diff --git a/app/views/api/user_preferences/_user_preference.json.jbuilder b/app/views/api/user_preferences/_user_preference.json.jbuilder
deleted file mode 100644 (file)
index 07eeaa9..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-attrs = {
-  user_preference.k => user_preference.v
-}
-
-json.preference(attrs)
index b3255562f6f15d16e6cb30340d788679e1c519c7..064bf27f237b6661623907672b0743059ae6e7c0 100644 (file)
@@ -1 +1,3 @@
-json.partial! @user_preferences
+json.partial! "api/root_attributes"
+
+json.preferences @user_preferences.map { |pref| [pref.k, pref.v] }.to_h