Sha256: cb06e24c90a1edbaf42de9fcb9cc62e83a99535449aab7d1f6b47565f20e36f0

Contents?: true

Size: 1.08 KB

Versions: 4

Compression:

Stored size: 1.08 KB

Contents

require 'active_record/fixtures'
require 'tasks/color'

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

  desc "upgrade enju_library"
  task :upgrade => :environment do
    LibraryGroup.transaction do
      update_color
      library_group = LibraryGroup.find(1)
      library_group.settings[:skip_mobile_agents] = ''
      library_group.settings[:max_number_of_results] = 500
      library_group.settings[:family_name_first] = true
      library_group.settings[:book_jacket_source] = 'google'
      library_group.settings[:screenshot_generator] = 'mozshot'
      library_group.save!
    end
    puts 'enju_library: The upgrade completed successfully.'
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
enju_library-0.2.0.beta.4 lib/tasks/enju_library_tasks.rake
enju_library-0.2.0.beta.3 lib/tasks/enju_library_tasks.rake
enju_library-0.2.0.beta.2 lib/tasks/enju_library_tasks.rake
enju_library-0.2.0.beta.1 lib/tasks/enju_library_tasks.rake