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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user