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:
parent
37e93914fc
commit
867bc3b48e
3 changed files with 118 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue