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.14.4 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.14.3 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.14.2 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.14.1 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.14.0 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.13.1 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.12.5 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.13.0 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.12.4 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.12.3 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.12.2 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.12.1 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.12.0 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.11.3 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.11.2 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.11.1 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.11.0 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.10.3 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.10.2 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.10.1 app/interactions/pulitzer/destroy_post_type_content_elements.rb