Sha256: e00fc447686841b8dd7841383ffe39311ae26bf14ba116803cfd230002cf857d

Contents?: true

Size: 356 Bytes

Versions: 74

Compression:

Stored size: 356 Bytes

Contents

class Pulitzer::DestroyPostTypeContentElements
  attr_accessor :post_type, :ptcet

  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.where(label: ptcet.label).each do |ce|
        ce.destroy
      end
    end
  end
end

Version data entries

74 entries across 74 versions & 1 rubygems

Version Path
pulitzer-0.10.0 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.5.14 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.5.13 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.5.11 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.5.10 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.5.9 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.5.8 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.5.7 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.5.6 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.5.5 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.5.4 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.5.3 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.5.2 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.5.1 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.5.0 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.4.16 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.4.15 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.4.14 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.4.13 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.4.12 app/interactions/pulitzer/destroy_post_type_content_elements.rb