Sha256: 743ef13efed3dc7fe7c94dc11622263ca30f02c4b54ba7d5daf18aa22cf5bb31

Contents?: true

Size: 461 Bytes

Versions: 52

Compression:

Stored size: 461 Bytes

Contents

class Pulitzer::UpdatePostTypeFreeFormSections
  attr_accessor :post_type, :ffst, :old_label

  def initialize(ffst, old_label=nil)
    self.post_type  = ffst.post_type
    self.ffst       = ffst
    self.old_label  = old_label || ffst.label
  end

  def call
    post_type.posts.each do |post|
      post.preview_version.free_form_sections.where(free_form_section_type_id: ffst.id).each do |ffs|
        ffs.update(name: ffst.name)
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
pulitzer-0.4.11 app/interactions/pulitzer/update_post_type_free_form_sections.rb
pulitzer-0.4.10 app/interactions/pulitzer/update_post_type_free_form_sections.rb
pulitzer-0.4.9 app/interactions/pulitzer/update_post_type_free_form_sections.rb
pulitzer-0.4.8 app/interactions/pulitzer/update_post_type_free_form_sections.rb
pulitzer-0.4.7 app/interactions/pulitzer/update_post_type_free_form_sections.rb
pulitzer-0.4.6 app/interactions/pulitzer/update_post_type_free_form_sections.rb
pulitzer-0.4.5 app/interactions/pulitzer/update_post_type_free_form_sections.rb
pulitzer-0.4.4 app/interactions/pulitzer/update_post_type_free_form_sections.rb
pulitzer-0.4.3 app/interactions/pulitzer/update_post_type_free_form_sections.rb
pulitzer-0.4.2 app/interactions/pulitzer/update_post_type_free_form_sections.rb
pulitzer-0.4.1 app/interactions/pulitzer/update_post_type_free_form_sections.rb
pulitzer-0.4.0 app/interactions/pulitzer/update_post_type_free_form_sections.rb