Sha256: caf5f42d9468c4160b147e6a2f57a4677065901757de87668ab23171a61b8e6f

Contents?: true

Size: 340 Bytes

Versions: 5

Compression:

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pulitzer-0.1.1 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.1.0 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.0.5 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.0.4 app/interactions/pulitzer/destroy_post_type_content_elements.rb
pulitzer-0.0.3 app/interactions/pulitzer/destroy_post_type_content_elements.rb