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:
Neil Lalonde
2013-09-03 17:19:29 -04:00
parent 1a6170a47c
commit 117fc8db58
16 changed files with 123 additions and 50 deletions

View File

@ -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)