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