Skip to content

Version 0.2.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@jcoyne jcoyne released this 28 Oct 15:38
· 1222 commits to master since this release

Upgrading from 0.1.0

in config/routes.rb
Change this line: root to: "catalog#index"

To:

  resources :welcome, only: 'index'
  root to: 'welcome#index'

Then rename GenericFile to FileSet:

git mv app/models/generic_file.rb app/models/file_set.rb

Then edit app/models/file_set.rb to look like this:

class FileSet < ActiveFedora::Base
  include ::CurationConcerns::FileSetBehavior
end
git mv app/controllers/curation_concerns/generic_files_controller.rb app/controllers/curation_concerns/file_sets_controller.rb

Then edit FileSetsController to look like:

module CurationConcerns
  class FileSetsController < ApplicationController
    include CurationConcerns::FileSetsControllerBehavior
  end
end
rails g migration RenameChecksumGenericFile

Then edit the generated migration to look like this:

class RenameChecksumGenericFile < ActiveRecord::Migration
  def change
    rename_column :checksum_audit_logs, :generic_file_id, :file_set_id
    rename_index :checksum_audit_logs, :by_generic_file_id_and_file_id, :by_file_set_id_and_file_id
  end
end

Then run rake db:migrate

Finally replace all occurrences of GenericFile with FileSet (except those in db/**)

find app -name "*.?rb" | xargs perl -pi -e 's/GenericFile/FileSet/g'
find spec -name "*.rb" | xargs perl -pi -e 's/GenericFile/FileSet/g'
find app -name "*.?rb" | xargs perl -pi -e 's/generic_file/file_set/g'
find spec -name "*.rb" | xargs perl -pi -e 's/generic_file/file_set/g'
find app/models -name "*.rb" | xargs perl -pi -e 's/GenericWorkBehavior/WorkBehavior/g'
find app -name "*.rb" | xargs perl -pi -e 's/GenericWorkIndexing/WorkIndexing/g'