Sha256: 5da69ce3dd65bdeca6689a14823622b52202f82cb02d7360141a131da16b05d0

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 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
    Item.transaction do
      update_item
      update_agent_type
      update_carrier_type
      update_content_type
      update_identifier_type
    end
    puts 'enju_biblio: The upgrade completed successfully.'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
enju_biblio-0.2.0.beta.2 lib/tasks/enju_biblio_tasks.rake
enju_biblio-0.2.0.beta.1 lib/tasks/enju_biblio_tasks.rake