From 5ce71bf941bf7fda8d70843fb764d9caf49127d4 Mon Sep 17 00:00:00 2001 From: "Stanko K.R." Date: Wed, 10 Dec 2025 15:13:35 +0100 Subject: [PATCH] Move Identities to My::Identities --- app/controllers/{ => my}/identities_controller.rb | 2 +- app/views/{ => my}/identities/_account.json.jbuilder | 0 app/views/{ => my}/identities/show.json.jbuilder | 2 +- config/routes.rb | 3 +-- test/controllers/{ => my}/identities_controller_test.rb | 4 ++-- 5 files changed, 5 insertions(+), 6 deletions(-) rename app/controllers/{ => my}/identities_controller.rb (59%) rename app/views/{ => my}/identities/_account.json.jbuilder (100%) rename app/views/{ => my}/identities/show.json.jbuilder (63%) rename test/controllers/{ => my}/identities_controller_test.rb (71%) diff --git a/app/controllers/identities_controller.rb b/app/controllers/my/identities_controller.rb similarity index 59% rename from app/controllers/identities_controller.rb rename to app/controllers/my/identities_controller.rb index f685cd348..7a388a3c3 100644 --- a/app/controllers/identities_controller.rb +++ b/app/controllers/my/identities_controller.rb @@ -1,4 +1,4 @@ -class IdentitiesController < ApplicationController +class My::IdentitiesController < ApplicationController disallow_account_scope def show diff --git a/app/views/identities/_account.json.jbuilder b/app/views/my/identities/_account.json.jbuilder similarity index 100% rename from app/views/identities/_account.json.jbuilder rename to app/views/my/identities/_account.json.jbuilder diff --git a/app/views/identities/show.json.jbuilder b/app/views/my/identities/show.json.jbuilder similarity index 63% rename from app/views/identities/show.json.jbuilder rename to app/views/my/identities/show.json.jbuilder index 5f8a1cefb..3d4ee1750 100644 --- a/app/views/identities/show.json.jbuilder +++ b/app/views/my/identities/show.json.jbuilder @@ -1,5 +1,5 @@ json.accounts @identity.users do |user| - json.partial! "identities/account", account: user.account + json.partial! "my/identities/account", account: user.account json.user do json.partial! "users/user", user: user end diff --git a/config/routes.rb b/config/routes.rb index 805b89f38..aa2815433 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -163,9 +163,8 @@ Rails.application.routes.draw do resource :landing - resource :identity, only: :show - namespace :my do + resource :identity, only: :show resources :access_tokens resources :pins resource :timezone diff --git a/test/controllers/identities_controller_test.rb b/test/controllers/my/identities_controller_test.rb similarity index 71% rename from test/controllers/identities_controller_test.rb rename to test/controllers/my/identities_controller_test.rb index 8d6e9a2fb..29e17cb85 100644 --- a/test/controllers/identities_controller_test.rb +++ b/test/controllers/my/identities_controller_test.rb @@ -1,6 +1,6 @@ require "test_helper" -class IdentitiesControllerTest < ActionDispatch::IntegrationTest +class My::IdentitiesControllerTest < ActionDispatch::IntegrationTest setup do sign_in_as :kevin end @@ -9,7 +9,7 @@ class IdentitiesControllerTest < ActionDispatch::IntegrationTest identity = identities(:kevin) untenanted do - get identity_path, as: :json + get my_identity_path, as: :json assert_response :success assert_equal identity.accounts.count, @response.parsed_body["accounts"].count end