mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
raw bbpress import script
amend post_creator to support custom fields
This commit is contained in:
@@ -18,6 +18,7 @@ class PostCreator
|
||||
# topic.
|
||||
# created_at - Post creation time (optional)
|
||||
# auto_track - Automatically track this topic if needed (default true)
|
||||
# custom_fields - Custom fields to be added to the post, Hash (default nil)
|
||||
#
|
||||
# When replying to a topic:
|
||||
# topic_id - topic we're replying to
|
||||
@@ -203,6 +204,10 @@ class PostCreator
|
||||
post.extract_quoted_post_numbers
|
||||
post.created_at = Time.zone.parse(@opts[:created_at].to_s) if @opts[:created_at].present?
|
||||
|
||||
if fields = @opts[:custom_fields]
|
||||
post.custom_fields = fields
|
||||
end
|
||||
|
||||
@post = post
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user