Sha256: 4758ba4edda0c5a0593b2af43eaab430ef8e5377a6f6c0f585e275951c6f044b

Contents?: true

Size: 1.32 KB

Versions: 11

Compression:

Stored size: 1.32 KB

Contents

require 'active_record/fixtures'
require 'tasks/profile'

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

    Rake::Task['enju_biblio:setup'].invoke
    Rake::Task['enju_library:setup'].invoke

    puts 'initial fixture files loaded.'
  end

  desc "import users from a TSV file"
  task :user_import => :environment do
    UserImportFile.import
  end

  desc "upgrade enju_leaf"
  task :upgrade => :environment do
    Rake::Task['enju_biblio:upgrade'].invoke
    Rake::Task['enju_circulation:upgrade'].invoke
    Rake::Task['enju_library:upgrade'].invoke
    Rake::Task['enju_message:upgrade'].invoke
    Rake::Task['enju_subject:upgrade'].invoke
    Profile.transaction do
      update_profile
    end
    puts 'enju_leaf: The upgrade completed successfully.'
  end

  desc "reindex all models"
  task :reindex, [:batch_size, :models, :silence] => :environment do |t, args|
    Rails::Engine.subclasses.each{|engine| engine.instance.eager_load!}
    Rake::Task['sunspot:reindex'].execute(args)
  end

  desc 'Export items'
  task :item => :environment do
    puts Manifestation.export(format: :txt)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
enju_leaf-1.1.4 lib/tasks/enju_leaf_tasks.rake
enju_leaf-1.1.3 lib/tasks/enju_leaf_tasks.rake
enju_leaf-1.1.2 lib/tasks/enju_leaf_tasks.rake
enju_leaf-1.1.1 lib/tasks/enju_leaf_tasks.rake
enju_leaf-1.1.0 lib/tasks/enju_leaf_tasks.rake
enju_leaf-1.1.0.rc22 lib/tasks/enju_leaf_tasks.rake
enju_leaf-1.1.0.rc21 lib/tasks/enju_leaf_tasks.rake
enju_leaf-1.1.0.rc20 lib/tasks/enju_leaf_tasks.rake
enju_leaf-1.1.0.rc19 lib/tasks/enju_leaf_tasks.rake
enju_leaf-1.1.0.rc18 lib/tasks/enju_leaf_tasks.rake
enju_leaf-1.1.0.rc17 lib/tasks/enju_leaf_tasks.rake