Sha256: 56711a6a35cb77ac2744a543e0466709c934f1eba20aa9404642b9b684713c15

Contents?: true

Size: 669 Bytes

Versions: 2

Compression:

Stored size: 669 Bytes

Contents

module FedoraMigrate
  class DatesMover < Mover
    Report = Struct.new(:uploaded, :modified)

    def migrate
      migrate_date_uploaded if source.respond_to?(:createdDate) && target.respond_to?(:date_uploaded)
      migrate_date_modified if source.respond_to?(:lastModifiedDate) && target.respond_to?(:date_modified)
      super
    end

    def results_report
      Report.new
    end

    def migrate_date_uploaded
      target.date_uploaded = source.createdDate
      report.uploaded = source.createdDate
    end

    def migrate_date_modified
      target.date_modified = source.lastModifiedDate
      report.modified = source.lastModifiedDate
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fedora-migrate-0.5.0 lib/fedora_migrate/dates_mover.rb
fedora-migrate-0.4.0 lib/fedora_migrate/dates_mover.rb