Sha256: 38e48ca38df547572cf22182d4be9b0be88de395178b941569adbba0bdcc366c

Contents?: true

Size: 522 Bytes

Versions: 5

Compression:

Stored size: 522 Bytes

Contents

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

    namespace :migrate do
      task :reset => ['db:second_base:drop', 'db:second_base:create', 'db:second_base:migrate']
    end
  end
end

%w{
  drop
}.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

5 entries across 5 versions & 1 rubygems

Version Path
secondbase-2.1.5 lib/second_base/databases_rails_four.rake
secondbase-2.1.4 lib/second_base/databases_rails_four.rake
secondbase-2.1.3 lib/second_base/databases_rails_four.rake
secondbase-2.1.2 lib/second_base/databases_rails_four.rake
secondbase-2.1.0 lib/second_base/databases_rails_four.rake