FEATURE: New 'Reviewable' model to make reviewable items generic

Includes support for flags, reviewable users and queued posts, with REST API
backwards compatibility.

Co-Authored-By: romanrizzi <romanalejandro@gmail.com>
Co-Authored-By: jjaffeux <j.jaffeux@gmail.com>
This commit is contained in:
Robin Ward
2019-01-03 12:03:01 -05:00
parent 9a56b398a1
commit b58867b6e9
354 changed files with 8090 additions and 5225 deletions

View File

@ -165,8 +165,6 @@ class ImportScripts::StackOverflow < ImportScripts::Base
end
end
LIKE ||= PostActionType.types[:like]
def import_likes
puts "", "Importing post likes..."
@ -196,7 +194,7 @@ class ImportScripts::StackOverflow < ImportScripts::Base
next unless post_id = post_id_from_imported_post_id(l["PostId"])
next unless user = User.find_by(id: user_id)
next unless post = Post.find_by(id: post_id)
PostAction.act(user, post, LIKE) rescue nil
PostActionCreator.like(user, post) rescue nil
end
end
@ -229,7 +227,7 @@ class ImportScripts::StackOverflow < ImportScripts::Base
next unless post_id = post_id_from_imported_post_id(l["PostCommentId"])
next unless user = User.find_by(id: user_id)
next unless post = Post.find_by(id: post_id)
PostAction.act(user, post, LIKE) rescue nil
PostActionCreator.like(user, post) rescue nil
end
end
end