aliases/implications: remove dead approving/updating code.
Remove the edit, update, and approve endpoints for tag aliases and implications. These have been useless since individual alias and implication requests were removed. Aliases and implications could only be edited or approved if they were in the pending state, which is no longer possible. Also remove unused new alias/implication request forms.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class TagAliasesController < ApplicationController
|
||||
before_action :admin_only, :only => [:approve, :new, :create]
|
||||
before_action :admin_only, only: [:destroy]
|
||||
respond_to :html, :xml, :json, :js
|
||||
|
||||
def show
|
||||
@@ -7,20 +7,6 @@ class TagAliasesController < ApplicationController
|
||||
respond_with(@tag_alias)
|
||||
end
|
||||
|
||||
def edit
|
||||
@tag_alias = TagAlias.find(params[:id])
|
||||
end
|
||||
|
||||
def update
|
||||
@tag_alias = TagAlias.find(params[:id])
|
||||
|
||||
if @tag_alias.is_pending? && @tag_alias.editable_by?(CurrentUser.user)
|
||||
@tag_alias.update(tag_alias_params)
|
||||
end
|
||||
|
||||
respond_with(@tag_alias)
|
||||
end
|
||||
|
||||
def index
|
||||
@tag_aliases = TagAlias.paginated_search(params, count_pages: true)
|
||||
@tag_aliases = @tag_aliases.includes(:antecedent_tag, :consequent_tag, :approver) if request.format.html?
|
||||
@@ -30,16 +16,9 @@ class TagAliasesController < ApplicationController
|
||||
|
||||
def destroy
|
||||
@tag_alias = TagAlias.find(params[:id])
|
||||
raise User::PrivilegeError unless @tag_alias.deletable_by?(CurrentUser.user)
|
||||
|
||||
@tag_alias.reject!
|
||||
respond_with(@tag_alias, location: tag_aliases_path, notice: "Tag alias was deleted")
|
||||
end
|
||||
|
||||
def approve
|
||||
@tag_alias = TagAlias.find(params[:id])
|
||||
@tag_alias.approve!(approver: CurrentUser.user)
|
||||
respond_with(@tag_alias, :location => tag_alias_path(@tag_alias))
|
||||
respond_with(@tag_alias, location: tag_aliases_path, notice: "Tag alias was deleted")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class TagImplicationsController < ApplicationController
|
||||
before_action :admin_only, :only => [:new, :create, :approve]
|
||||
before_action :admin_only, only: [:destroy]
|
||||
respond_to :html, :xml, :json, :js
|
||||
|
||||
def show
|
||||
@@ -7,20 +7,6 @@ class TagImplicationsController < ApplicationController
|
||||
respond_with(@tag_implication)
|
||||
end
|
||||
|
||||
def edit
|
||||
@tag_implication = TagImplication.find(params[:id])
|
||||
end
|
||||
|
||||
def update
|
||||
@tag_implication = TagImplication.find(params[:id])
|
||||
|
||||
if @tag_implication.is_pending? && @tag_implication.editable_by?(CurrentUser.user)
|
||||
@tag_implication.update(tag_implication_params)
|
||||
end
|
||||
|
||||
respond_with(@tag_implication)
|
||||
end
|
||||
|
||||
def index
|
||||
@tag_implications = TagImplication.paginated_search(params, count_pages: true)
|
||||
@tag_implications = @tag_implications.includes(:antecedent_tag, :consequent_tag, :approver) if request.format.html?
|
||||
@@ -30,16 +16,9 @@ class TagImplicationsController < ApplicationController
|
||||
|
||||
def destroy
|
||||
@tag_implication = TagImplication.find(params[:id])
|
||||
raise User::PrivilegeError unless @tag_implication.deletable_by?(CurrentUser.user)
|
||||
|
||||
@tag_implication.reject!
|
||||
respond_with(@tag_implication, location: tag_implications_path, notice: "Tag implication was deleted")
|
||||
end
|
||||
|
||||
def approve
|
||||
@tag_implication = TagImplication.find(params[:id])
|
||||
@tag_implication.approve!(approver: CurrentUser.user)
|
||||
respond_with(@tag_implication, :location => tag_implication_path(@tag_implication))
|
||||
respond_with(@tag_implication, location: tag_implications_path, notice: "Tag implication was deleted")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user