allow editing of pending aliases/implications

This commit is contained in:
r888888888
2014-07-18 14:48:51 -07:00
parent 5fd6a018cb
commit c1a4bfda55
11 changed files with 173 additions and 3 deletions

View File

@@ -12,6 +12,20 @@ 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_attributes(params[:tag_alias])
end
respond_with(@tag_alias)
end
def index
@search = TagAlias.search(params[:search])
@tag_aliases = @search.order("(case status when 'pending' then 0 when 'queued' then 1 else 2 end), antecedent_name, consequent_name").paginate(params[:page], :limit => params[:limit])

View File

@@ -12,6 +12,20 @@ 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_attributes(params[:tag_implication])
end
respond_with(@tag_implication)
end
def index
@search = TagImplication.search(params[:search])
@tag_implications = @search.order("(case status when 'pending' then 0 when 'queued' then 1 else 2 end), antecedent_name, consequent_name").paginate(params[:page], :limit => params[:limit])