Sha256: 6f97f20a79335575d0f348e1a4d6316116ddd18edc8b757dd420098794b2f72c

Contents?: true

Size: 645 Bytes

Versions: 2

Compression:

Stored size: 645 Bytes

Contents

namespace :db do
  namespace :second_base do
    task "drop:_unsafe" do
      SecondBase.on_base { Rake::Task['db:drop:_unsafe'].execute }
    end

    namespace :migrate do
      desc 'Resets SecondBase database using your migrations for the current environment'
      task :reset => ['db:second_base:drop:_unsafe', 'db:second_base:create', 'db:second_base:migrate']
    end
  end
end

%w{
  drop:_unsafe
}.each do |name|
  task = Rake::Task["db:#{name}"] rescue nil
  next unless task && SecondBase::Railtie.run_with_db_tasks?
  task.enhance do
    Rake::Task["db:load_config"].invoke
    Rake::Task["db:second_base:#{name}"].invoke
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
secondbase-2.2.0 lib/second_base/databases_rails_five.rake
secondbase-2.1.6 lib/second_base/databases_rails_five.rake