Sha256: 3cd49029076a8fdfd51d5f0bf3b17779c1966f3dee27583b2dbb6a17311adb16

Contents?: true

Size: 502 Bytes

Versions: 4

Compression:

Stored size: 502 Bytes

Contents

class Pulitzer::CloneVersion
  attr_accessor :version, :action, :new_version

  def initialize(version, new_version)
    self.version      = version
    self.new_version  = new_version
  end

  def call
    version.content_elements.each do |ce|
      element = ce.dup
      element.version_id = nil
      new_version.content_elements << element
    end
    version.post_tags.each do |pt|
      post_tag = pt.dup
      post_tag.version_id = nil
      new_version.post_tags << post_tag
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pulitzer-0.1.5 app/interactions/pulitzer/clone_version.rb
pulitzer-0.1.4 app/interactions/pulitzer/clone_version.rb
pulitzer-0.1.3 app/interactions/pulitzer/clone_version.rb
pulitzer-0.1.2 app/interactions/pulitzer/clone_version.rb