This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :db do | |
namespace :data do | |
desc "Load data from sql script file (FILENAME=[data file]) into offices table" | |
task :load_mysql_dump => 'environment' do | |
environment = (ENV.include?("RAILS_ENV")) ? (ENV["RAILS_ENV"]) : 'development' | |
ENV["RAILS_ENV"] = RAILS_ENV = environment | |
database = Rails.configuration.database_configuration[Rails.env]["database"] | |
user = Rails.configuration.database_configuration[Rails.env]["username"] | |
password = Rails.configuration.database_configuration[Rails.env]["password"] |