Class: Decidim::Posts::UpdatePost
- Inherits:
-
Command
- Object
- Command
- Decidim::Posts::UpdatePost
- Includes:
- MultipleAttachmentsMethods
- Defined in:
- app/commands/decidim/posts/update_post.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(form, current_user, post) ⇒ UpdatePost
constructor
A new instance of UpdatePost.
Constructor Details
#initialize(form, current_user, post) ⇒ UpdatePost
Returns a new instance of UpdatePost.
6 7 8 9 10 11 |
# File 'app/commands/decidim/posts/update_post.rb', line 6 def initialize(form, current_user, post) @form = form @current_user = current_user @post = post @attached_to = post end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/commands/decidim/posts/update_post.rb', line 13 def call return broadcast(:invalid) if invalid? if return broadcast(:invalid) if end with_events(with_transaction: true) do #Decidim.traceability.perform_action!("update_feeds_post", Post, form.current_user) do update_post #end document_cleanup!(include_all_attachments: true) if end broadcast(:ok, @post) end |