Sha256: fdb6646ed5c4920bcb7186f59c7956e8fd52576dcf18c50da88736a69edf9fed

Contents?: true

Size: 1.15 KB

Versions: 4

Compression:

Stored size: 1.15 KB

Contents

require 'active_record/fixtures'
require 'tasks/agent_type'
require 'tasks/carrier_type'
require 'tasks/content_type'
require 'tasks/identifier_type'
require 'tasks/item'

namespace :enju_biblio do
  desc "create initial records for enju_biblio"
  task :setup => :environment do
    Dir.glob(Rails.root.to_s + '/db/fixtures/enju_biblio/*.yml').each do |file|
      ActiveRecord::FixtureSet.create_fixtures('db/fixtures/enju_biblio', File.basename(file, '.*'))
    end
  end

  desc "import manifestations and items from a TSV file"
  task :resource_import => :environment do
    ResourceImportFile.import
  end

  desc "import manifestations and items from a TSV file"
  task :agent_import => :environment do
    AgentImportFile.import
  end

  desc "upgrade enju_biblio"
  task :upgrade => :environment do
    Rake::Task['statesman:backfill_most_recent'].invoke('AgentImportFile')
    Rake::Task['statesman:backfill_most_recent'].invoke('ImportRequest')
    Rake::Task['statesman:backfill_most_recent'].invoke('ResourceExportFile')
    Rake::Task['statesman:backfill_most_recent'].invoke('ResourceImportFile')
    puts 'enju_biblio: The upgrade completed successfully.'
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/enju_biblio-0.2.0/lib/tasks/enju_biblio_tasks.rake
enju_biblio-0.2.0 lib/tasks/enju_biblio_tasks.rake
enju_biblio-0.2.0.beta.4 lib/tasks/enju_biblio_tasks.rake
enju_biblio-0.2.0.beta.3 lib/tasks/enju_biblio_tasks.rake