Class: Decidim::Blogs::PostForm

Inherits:
Form
  • Object
show all
Includes:
AttachmentAttributes, HasTaxonomyFormAttributes, HasUploadValidations, TranslatableAttributes
Defined in:
app/forms/decidim/blogs/post_form.rb

Overview

This class holds a Form to update pages from Decidim’s admin panel.

Instance Method Summary collapse

Instance Method Details

#authorObject



34
35
36
37
38
39
# File 'app/forms/decidim/blogs/post_form.rb', line 34

def author
  @author ||= Decidim::UserBaseEntity.find_by(
    organization: current_organization,
    id: decidim_author_id
  )
end

#map_model(model) ⇒ Object



26
27
28
29
30
31
32
# File 'app/forms/decidim/blogs/post_form.rb', line 26

def map_model(model)
  presenter = PostPresenter.new(model)

  self.title = presenter.title
  self.body = presenter.body
  self.documents = model.attachments
end