mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +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:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user