mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FEATURE: Allow posting a link with topics
This commit is contained in:
@ -28,7 +28,7 @@ module Helpers
|
||||
args[:title] ||= "This is my title #{Helpers.next_seq}"
|
||||
user = args.delete(:user) || Fabricate(:user)
|
||||
guardian = Guardian.new(user)
|
||||
args[:category] = args[:category].name if args[:category].is_a?(Category)
|
||||
args[:category] = args[:category].id if args[:category].is_a?(Category)
|
||||
TopicCreator.create(user, guardian, args)
|
||||
end
|
||||
|
||||
@ -37,7 +37,7 @@ module Helpers
|
||||
args[:raw] ||= "This is the raw body of my post, it is cool #{Helpers.next_seq}"
|
||||
args[:topic_id] = args[:topic].id if args[:topic]
|
||||
user = args.delete(:user) || Fabricate(:user)
|
||||
args[:category] = args[:category].name if args[:category].is_a?(Category)
|
||||
args[:category] = args[:category].id if args[:category].is_a?(Category)
|
||||
creator = PostCreator.new(user, args)
|
||||
post = creator.create
|
||||
|
||||
|
Reference in New Issue
Block a user