diff --git a/app/models/user.rb b/app/models/user.rb index 6ed95ddb3..743471049 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -96,7 +96,7 @@ class User < ApplicationRecord class_name: :PortalMember, dependent: :destroy_async has_many :portals, - through: :portals_members, + through: :portal_members, class_name: :Portal, dependent: :nullify, source: :portal diff --git a/config/routes.rb b/config/routes.rb index 8b9b43863..b5a5cbdc7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -346,7 +346,7 @@ Rails.application.routes.draw do resources :accounts, only: [:index, :new, :create, :show, :edit, :update] do post :seed, on: :member end - resources :users, only: [:index, :new, :create, :show, :edit, :update] + resources :users, only: [:index, :new, :create, :show, :edit, :update, :destroy] resources :access_tokens, only: [:index, :show] resources :installation_configs, only: [:index, :new, :create, :show, :edit, :update] resources :agent_bots, only: [:index, :new, :create, :show, :edit, :update]