2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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