From 5905f4aed12d9c53c5818c06fb6e9cdcae8e15e5 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 11 Nov 2023 14:57:56 -0800 Subject: [PATCH] Delete more unused code Just some routes and controllers that I think were at various points serving as API endpoints, but no longer do I think! --- app/controllers/pet_attributes_controller.rb | 8 -------- app/controllers/pet_types_controller.rb | 10 ---------- app/controllers/swf_assets_controller.rb | 11 ----------- app/controllers/zones_controller.rb | 5 ----- app/helpers/item_zone_sets_helper.rb | 2 -- app/views/swf_assets/links.html.haml | 8 -------- config/routes.rb | 8 -------- 7 files changed, 52 deletions(-) delete mode 100644 app/controllers/pet_attributes_controller.rb delete mode 100644 app/controllers/pet_types_controller.rb delete mode 100644 app/controllers/swf_assets_controller.rb delete mode 100644 app/controllers/zones_controller.rb delete mode 100644 app/helpers/item_zone_sets_helper.rb delete mode 100644 app/views/swf_assets/links.html.haml diff --git a/app/controllers/pet_attributes_controller.rb b/app/controllers/pet_attributes_controller.rb deleted file mode 100644 index 1a74a7c5..00000000 --- a/app/controllers/pet_attributes_controller.rb +++ /dev/null @@ -1,8 +0,0 @@ -class PetAttributesController < ApplicationController - def index - render :json => { - :color => Color.funny.alphabetical, - :species => Species.alphabetical - } - end -end diff --git a/app/controllers/pet_types_controller.rb b/app/controllers/pet_types_controller.rb deleted file mode 100644 index cc1dacd0..00000000 --- a/app/controllers/pet_types_controller.rb +++ /dev/null @@ -1,10 +0,0 @@ -class PetTypesController < ApplicationController - def show - pet_type = PetType.find_by_color_id_and_species_id(params[:color_id], params[:species_id]) - if pet_type - render :json => pet_type.as_json(:for => params[:for]) - else - render :json => nil - end - end -end diff --git a/app/controllers/swf_assets_controller.rb b/app/controllers/swf_assets_controller.rb deleted file mode 100644 index 9229c207..00000000 --- a/app/controllers/swf_assets_controller.rb +++ /dev/null @@ -1,11 +0,0 @@ -class SwfAssetsController < ApplicationController - def show - @swf_asset = SwfAsset.find params[:id] - render :json => @swf_asset - end - - def links - @swf_assets = SwfAsset.from_wardrobe_link_params(params[:asset_ids]) - end -end - diff --git a/app/controllers/zones_controller.rb b/app/controllers/zones_controller.rb deleted file mode 100644 index 92c4a75b..00000000 --- a/app/controllers/zones_controller.rb +++ /dev/null @@ -1,5 +0,0 @@ -class ZonesController < ApplicationController - def index - render json: Zone.includes(:translations).all - end -end diff --git a/app/helpers/item_zone_sets_helper.rb b/app/helpers/item_zone_sets_helper.rb deleted file mode 100644 index 4aabf267..00000000 --- a/app/helpers/item_zone_sets_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module ItemZoneSetsHelper -end diff --git a/app/views/swf_assets/links.html.haml b/app/views/swf_assets/links.html.haml deleted file mode 100644 index e3dda75d..00000000 --- a/app/views/swf_assets/links.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -- title t('.title') - -%ul#swf-assets - - @swf_assets.each do |swf_asset| - %li - = link_to swf_asset.url do - = image_tag(swf_asset.image_url([150, 150])) - %span= swf_asset.url diff --git a/config/routes.rb b/config/routes.rb index 3d02b1e6..d90f2cfb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -7,8 +7,6 @@ OpenneoImpressItems::Application.routes.draw do get '/wardrobe' => redirect('/outfits/new') get '/start/:color_name/:species_name' => 'outfits#start' - get '/species/:species_id/color/:color_id/pet_type.json' => 'pet_types#show' - resources :contributions, :only => [:index] resources :items, :only => [:index, :show] do resources :appearances, controller: 'item_appearances', only: [:index] @@ -18,12 +16,6 @@ OpenneoImpressItems::Application.routes.draw do end resources :outfits, :only => [:show, :create, :update, :destroy] resources :pet_attributes, :only => [:index] - resources :swf_assets, :only => [:show] do - collection do - get :links - end - end - resources :zones, only: [:index] scope 'import' do resources :neopets_page_import_tasks, only: [:new, :create],