From 982658d3abd46c62cd80d9dc7c5d91f1db5175cf Mon Sep 17 00:00:00 2001 From: Andy Zhao Date: Wed, 5 Jun 2019 19:01:34 -0400 Subject: [PATCH] Remove switch organizations tab from settings and clear Rails cache for PUT /admin/organizations (#3045) * Remove switch organization functionality * Touch profile_updated_at when updating org --- app/controllers/admin/organizations_controller.rb | 5 +++++ app/models/user.rb | 6 +++--- app/views/users/_switch_organizations.html.erb | 4 ---- 3 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 app/views/users/_switch_organizations.html.erb diff --git a/app/controllers/admin/organizations_controller.rb b/app/controllers/admin/organizations_controller.rb index 4e11f1344..353c0df9f 100644 --- a/app/controllers/admin/organizations_controller.rb +++ b/app/controllers/admin/organizations_controller.rb @@ -8,6 +8,11 @@ module Admin # @resources = Organization.all.paginate(10, params[:page]) # end + def update + super + @requested_resource.touch(:profile_updated_at) + end + # Define a custom finder by overriding the `find_resource` method: # def find_resource(param) # Organization.find_by!(slug: param) diff --git a/app/models/user.rb b/app/models/user.rb index 6a51ffce5..60dd4d3ab 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -404,16 +404,16 @@ class User < ApplicationRecord end def settings_tab_list - tab_list = %w[ + %w[ Profile Integrations Notifications Publishing\ from\ RSS Organization Billing + Account + Misc ] - tab_list << "Switch Organizations" if has_role?(:switch_between_orgs) - tab_list.push("Account", "Misc") end def profile_image_90 diff --git a/app/views/users/_switch_organizations.html.erb b/app/views/users/_switch_organizations.html.erb deleted file mode 100644 index f805e2d42..000000000 --- a/app/views/users/_switch_organizations.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<% if @user.has_role?(:switch_between_orgs) %> -

Hey Mary 👋

- <%= render "users/org_non_member" %> -<% end %>