Class: Decidim::Posts::CreatePost
- Inherits:
-
Command
- Object
- Command
- Decidim::Posts::CreatePost
- Includes:
- MultipleAttachmentsMethods
- Defined in:
- app/commands/decidim/posts/create_post.rb
Overview
This command is executed when a participant or user group creates a Meeting from the public views.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(form) ⇒ CreatePost
constructor
A new instance of CreatePost.
Constructor Details
#initialize(form) ⇒ CreatePost
Returns a new instance of CreatePost.
11 12 13 |
# File 'app/commands/decidim/posts/create_post.rb', line 11 def initialize(form) @form = form end |
Instance Method Details
#call ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/commands/decidim/posts/create_post.rb', line 15 def call return broadcast(:invalid) if form.invalid? if return broadcast(:invalid) if end with_events(with_transaction: true) do Decidim.traceability.perform_action!("create_feeds_post", Post, form.current_user) do create_post end # create_attachments(weight: first_attachment_weight) if process_attachments? if end # create_follow_form_resource(form.current_user) #send_notification broadcast(:ok, post) end |