From 48ed227fc56e0a5641879c4e8b07bb2217716736 Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 6 Oct 2019 00:38:38 -0500 Subject: [PATCH] views: reduce set of data attributes. Some API attributes aren't generally useful or are too expensive to calculate on every pageload. Only include basic attributes plus account settings. --- app/helpers/application_helper.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c63b0434a..afb16fa60 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -175,8 +175,7 @@ module ApplicationHelper end def body_attributes(user = CurrentUser.user) - attributes = user.api_attributes - attributes -= [:custom_style, :blacklisted_tags, :favorite_tags] + attributes = %i[id name level level_string theme] + User::BOOLEAN_ATTRIBUTES.map(&:to_sym) attributes += User::Roles.map { |role| :"is_#{role}?" } controller_param = params[:controller].parameterize.dasherize