From e58571524b73edb8e0217074bf9dd0eee7a6c70d Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Wed, 27 Nov 2019 14:04:19 -0600 Subject: [PATCH] Don't use root in to_json calls --- app/views/layouts/_app_data.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/_app_data.html.erb b/app/views/layouts/_app_data.html.erb index 69033f64..bb4f3d72 100644 --- a/app/views/layouts/_app_data.html.erb +++ b/app/views/layouts/_app_data.html.erb @@ -5,11 +5,11 @@ var app = { , ip: "<%= request.remote_ip %>" , current_user: <%= current_user ? current_user.id : 'undefined' %> , current_admin: <%= !!(current_user && current_role?(:super_admin)) %> -, nonprofit: <%= @nonprofit ? raw(@nonprofit.to_json) : 'undefined' %> +, nonprofit: <%= @nonprofit ? raw(@nonprofit.to_json(root:false)) : 'undefined' %> , nonprofit_id : <%= @nonprofit ? @nonprofit.id : 'undefined' %> -, user: <%= current_user ? raw(current_user.to_json) : 'undefined' %> +, user: <%= current_user ? raw(current_user.to_json(root:false)) : 'undefined' %> , user_id: <%= current_user ? current_user.id : 'undefined' %> -, profile: <%= current_user ? raw(current_user.profile.to_json) : 'undefined' %> +, profile: <%= current_user ? raw(current_user.profile.to_json(root:false)) : 'undefined' %> , profile_id: <%= current_user ? current_user.profile.id : 'undefined' %> , asset_path: "<%= Rails.application.config.assets.prefix %>" , host_with_port: "//<%= request.host_with_port %>"