2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

Convert Post type constants to Enum

This commit is contained in:
Robin Ward 2013-03-18 16:03:46 -04:00
parent 897d48b145
commit c1e40f5d19
6 changed files with 11 additions and 10 deletions

View file

@ -320,7 +320,7 @@ class Topic < ActiveRecord::Base
def add_moderator_post(user, text, opts={})
new_post = nil
Topic.transaction do
new_post = posts.create(user: user, raw: text, post_type: Post::MODERATOR_ACTION, no_bump: opts[:bump].blank?)
new_post = posts.create(user: user, raw: text, post_type: Post.types[:moderator_action], no_bump: opts[:bump].blank?)
increment!(:moderator_posts_count)
new_post
end