remove acts_as_paranoid, use .trash! , .recover! and .with_deleted as needed

makes upgrading to rails 4 possible
This commit is contained in:
Sam
2013-05-07 14:39:01 +10:00
parent a71a15913c
commit e9fc272db7
21 changed files with 77 additions and 36 deletions

View File

@ -33,7 +33,7 @@ class InvitesController < ApplicationController
invite = Invite.where(invited_by_id: current_user.id, email: params[:email]).first
raise Discourse::InvalidParameters.new(:email) if invite.blank?
invite.destroy
invite.trash!
render nothing: true
end

View File

@ -128,7 +128,7 @@ class PostsController < ApplicationController
def recover
post = find_post_from_params
guardian.ensure_can_recover_post!(post)
post.recover
post.recover!
render nothing: true
end

View File

@ -100,7 +100,7 @@ class TopicsController < ApplicationController
def destroy
topic = Topic.where(id: params[:id]).first
guardian.ensure_can_delete!(topic)
topic.destroy
topic.trash!
render nothing: true
end