FIX: Change base importer to create new Bookmark records (#9603)

Also add a spec and fixture with a mock importer that we can use to test the create_X methods of the base importer
This commit is contained in:
Martin Brennan
2020-05-01 11:34:55 +10:00
committed by GitHub
parent 37e93914fc
commit 867bc3b48e
3 changed files with 118 additions and 3 deletions

View File

@ -606,9 +606,10 @@ class ImportScripts::Base
skipped += 1
puts "Skipping bookmark for user id #{params[:user_id]} and post id #{params[:post_id]}"
else
result = PostActionCreator.create(user, post, :bookmark)
created += 1 if result.success?
skipped += 1 if result.failed?
result = BookmarkManager.new(user).create(post_id: post.id)
created += 1 if result.errors.none?
skipped += 1 if result.errors.any?
end
end