Commit c1725f6d authored by Albert Yi's avatar Albert Yi

eliminate artist undelete action on controller

parent 52de1fb9
......@@ -74,14 +74,6 @@ class ArtistsController < ApplicationController
redirect_to(artist_path(@artist), :notice => "Artist deleted")
end
def undelete
if !@artist.deletable_by?(CurrentUser.user)
raise User::PrivilegeError
end
@artist.update_attribute(:is_active, true)
redirect_to(artist_path(@artist), :notice => "Artist undeleted")
end
def revert
@artist = Artist.find(params[:id])
@version = @artist.versions.find(params[:version_id])
......
......@@ -15,9 +15,9 @@
<li><%= link_to "History", artist_versions_path(:search => {:artist_id => @artist.id}) %></li>
<% if @artist.deletable_by?(CurrentUser.user) %>
<% if @artist.is_active? %>
<li id="artist-delete"><%= link_to "Delete", artist_path(@artist), :method => :delete, :data => {:confirm => "Are you sure you want to delete this artist?"} %></li>
<li id="artist-delete"><%= link_to "Delete", artist_path(@artist), method: :delete, data: {confirm: "Are you sure you want to delete this artist?"} %></li>
<% else %>
<li><%= link_to "Undelete", undelete_artist_path(@artist), :method => :post, :data => {:confirm => "Are you sure you want to undelete this artist?"} %></li>
<li><%= link_to "Undelete", artist_path(@artist), method: :put, data: {confirm: "Are you sure you want to undelete this artist?", params: {"artist[is_active]" => true}} %></li>
<% end %>
<% end %>
<% if CurrentUser.is_admin? %>
......
......@@ -74,7 +74,6 @@ Rails.application.routes.draw do
put :revert
put :ban
put :unban
post :undelete
end
collection do
get :show_or_new
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment