mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
Change the way nuked users' posts are handled. Allow null in the user_id column of posts. Show these posts in the posts stream.
This commit is contained in:
@ -13,9 +13,12 @@ class Validators::PostValidator < ActiveModel::Validator
|
||||
end
|
||||
|
||||
def presence(post)
|
||||
[:raw,:user_id,:topic_id].each do |attr_name|
|
||||
[:raw,:topic_id].each do |attr_name|
|
||||
post.errors.add(attr_name, :blank, options) if post.send(attr_name).blank?
|
||||
end
|
||||
if post.new_record? and post.user_id.nil?
|
||||
post.errors.add(:user_id, :blank, options)
|
||||
end
|
||||
end
|
||||
|
||||
def stripped_length(post)
|
||||
|
Reference in New Issue
Block a user