FEATURE: Add a trigger for plugins to include their own jobs.
This commit is contained in:
parent
8bc7423045
commit
cbb86f9bf6
|
@ -498,6 +498,7 @@ class Post < ActiveRecord::Base
|
|||
args[:image_sizes] = image_sizes if image_sizes.present?
|
||||
args[:invalidate_oneboxes] = true if invalidate_oneboxes.present?
|
||||
Jobs.enqueue(:process_post, args)
|
||||
DiscourseEvent.trigger(:after_trigger_post_process, self)
|
||||
end
|
||||
|
||||
def self.public_posts_count_per_day(start_date, end_date, category_id=nil)
|
||||
|
|
|
@ -75,6 +75,7 @@ describe PostCreator do
|
|||
DiscourseEvent.expects(:trigger).with(:post_created, anything, anything, user).once
|
||||
DiscourseEvent.expects(:trigger).with(:after_validate_topic, anything, anything).once
|
||||
DiscourseEvent.expects(:trigger).with(:before_create_topic, anything, anything).once
|
||||
DiscourseEvent.expects(:trigger).with(:after_trigger_post_process, anything).once
|
||||
creator.create
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue