Sha256: 07a9e6994bdae688d1f96d48041b175ea6389ff074251d2aa334473afcc8921b

Contents?: true

Size: 734 Bytes

Versions: 39

Compression:

Stored size: 734 Bytes

Contents

class Pulitzer::CreatePostContentElements
  attr_accessor :post

  def initialize(post)
    self.post = post
  end

  def call
    post.post_type_content_element_types.each do |cet|
      post.preview_version.content_elements.create do |ce|
        ce.label                          = cet.label
        ce.height                         = cet.height
        ce.width                          = cet.width
        ce.text_editor                    = cet.text_editor
        ce.content_element_type           = cet.content_element_type
        ce.post_type_content_element_type = cet
      end
    end
    post.free_form_section_types.each do |ffst|
      post.preview_version.free_form_sections.create name: ffst.name
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
pulitzer-0.11.3 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.11.2 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.11.1 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.11.0 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.10.3 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.10.2 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.10.1 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.10.0 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.5.14 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.5.13 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.5.11 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.5.10 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.5.9 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.5.8 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.5.7 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.5.6 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.5.5 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.5.4 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.5.3 app/interactions/pulitzer/create_post_content_elements.rb
pulitzer-0.5.2 app/interactions/pulitzer/create_post_content_elements.rb