remove unnecessary api v1 code

This commit is contained in:
Devin Howard 2016-10-08 14:00:29 +08:00
parent 2c64b67abd
commit 9513087bbd
7 changed files with 6 additions and 49 deletions

View file

@ -2,11 +2,11 @@
module Api
module V1
class DeprecatedController < ApplicationController
# rubocop:disable Style/MethodMissing
def method_missing
render json: { error: '/api/v1 is deprecated! Please use /api/v2 instead.' }, status: :gone
def deprecated
render json: {
error: '/api/v1 has been deprecated! Please use /api/v2 instead.'
}, status: :gone
end
# rubocop:enable Style/MethodMissing
end
end
end

View file

@ -1,7 +0,0 @@
# frozen_string_literal: true
module Api
module V1
class MappingsController < DeprecatedController
end
end
end

View file

@ -1,7 +0,0 @@
# frozen_string_literal: true
module Api
module V1
class MapsController < DeprecatedController
end
end
end

View file

@ -1,7 +0,0 @@
# frozen_string_literal: true
module Api
module V1
class SynapsesController < DeprecatedController
end
end
end

View file

@ -1,7 +0,0 @@
# frozen_string_literal: true
module Api
module V1
class TokensController < DeprecatedController
end
end
end

View file

@ -1,7 +0,0 @@
# frozen_string_literal: true
module Api
module V1
class TopicsController < DeprecatedController
end
end
end

View file

@ -80,16 +80,8 @@ Metamaps::Application.routes.draw do
match '*path', to: 'restful#catch_404', via: :all
end
namespace :v1, path: '/v1' do
# api v1 routes all lead to a deprecation error method
# see app/controllers/api/v1/deprecated_controller.rb
resources :maps, only: [:create, :show, :update, :destroy]
resources :synapses, only: [:create, :show, :update, :destroy]
resources :topics, only: [:create, :show, :update, :destroy]
resources :mappings, only: [:create, :show, :update, :destroy]
resources :tokens, only: [:create, :destroy] do
get :my_tokens, on: :collection
end
match '*path', to: 'deprecated#method_missing', via: :all
root to: 'deprecated#deprecated', via: :all
match '*path', to: 'deprecated#deprecated', via: :all
end
match '*path', to: 'v2/restful#catch_404', via: :all
end