Sha256: 2ef8b75f1379eaa129f4b8d0283ab8936a9bf6c7ee70270be72bb3e6f71beaa9

Contents?: true

Size: 676 Bytes

Versions: 73

Compression:

Stored size: 676 Bytes

Contents

class Pulitzer::CreatePostTypeContentElements
  attr_accessor :post_type, :ptcet, :old_label

  def initialize(ptcet)
    self.post_type  = ptcet.post_type
    self.ptcet      = ptcet
  end

  def call
    post_type.posts.each do |post|
      post.preview_version.content_elements.create do |ce|
        ce.label                          = ptcet.label
        ce.height                         = ptcet.height
        ce.width                          = ptcet.width
        ce.text_editor                    = ptcet.text_editor
        ce.content_element_type           = ptcet.content_element_type
        ce.post_type_content_element_type = ptcet
      end
    end
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
pulitzer-0.4.11 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.4.10 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.4.9 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.4.8 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.4.7 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.4.6 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.4.5 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.4.4 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.4.3 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.4.2 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.4.1 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.4.0 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.3.9 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.3.8 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.3.7 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.3.6 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.3.5 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.3.4 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.3.3 app/interactions/pulitzer/create_post_type_content_elements.rb
pulitzer-0.3.2 app/interactions/pulitzer/create_post_type_content_elements.rb