Sha256: ddd3206cf5dd19433c52516b15a8817539e7a838e02ae7b9a7878426e3e4d161
Contents?: true
Size: 808 Bytes
Versions: 9
Compression:
Stored size: 808 Bytes
Contents
class Pulitzer::CreateFreeFormSectionPartials def initialize(partial_type) @partial_type = partial_type end def call free_form_section_type = @partial_type.free_form_section_type post_type = free_form_section_type.post_type post_type.posts.each do |post| if post.preview_version free_form_section = post.preview_version.free_form_sections.find_by(name: free_form_section_type.name) partial = free_form_section.partials.create do |p| p.label = @partial_type.label p.sort_order = @partial_type.sort_order p.post_type_id = @partial_type.post_type_id p.layout_id = @partial_type.layout_id end Pulitzer::CreatePartialContentElements.new(partial).call end end end end
Version data entries
9 entries across 9 versions & 1 rubygems