DEV: Replace magic values (#8398)

Follow-up to 35942f7c7c9510161c42018543ac609254dafdbd.
This commit is contained in:
Dan Ungureanu
2019-11-25 14:32:19 +02:00
committed by GitHub
parent ae9e881333
commit a992caf741
10 changed files with 38 additions and 33 deletions

View File

@ -478,8 +478,8 @@ class PostsController < ApplicationController
post = find_post_from_params
if params[:notice].present?
post.custom_fields["notice_type"] = Post.notices[:custom]
post.custom_fields["notice_args"] = PrettyText.cook(params[:notice], features: { onebox: false })
post.custom_fields[Post::NOTICE_TYPE] = Post.notices[:custom]
post.custom_fields[Post::NOTICE_ARGS] = PrettyText.cook(params[:notice], features: { onebox: false })
post.save_custom_fields
else
post.delete_post_notices