Remove method not used at artciles controller (#9877)

This commit is contained in:
Brunno Souza 2020-08-25 04:47:32 -03:00 committed by GitHub
parent ad2184ebf6
commit 7f64e38caa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -292,20 +292,6 @@ class ArticlesController < ApplicationController
end
end
def redirect_after_creation
@article.decorate
if @article.persisted?
redirect_to @article.current_state_path, notice: "Article was successfully created."
else
if @article.errors.to_h[:body_markdown] == "has already been taken"
@article = current_user.articles.find_by(body_markdown: @article.body_markdown)
redirect_to @article.current_state_path
return
end
render :new
end
end
def allowed_to_change_org_id?
potential_user = @article&.user || current_user
potential_org_id = params["article"]["organization_id"].presence || @article&.organization_id