I recently added a second database to my development Rails site, and made a custom rake task, 'SysConfig:db:migrate' which can be seen below:
namespace :SysConfig do
task :set_custom_db_config_paths do
ENV['SCHEMA'] = 'db_sysconfig/schema.rb'
Rails.application.config.paths['db'] = ['db_sysconfig']
Rails.application.config.paths['db/migrate'] = ['db_sysconfig/migrate']
Rails.application.config.paths['db/seeds'] = ['db_sysconfig/seeds.rb']
Rails.application.config.paths['config/database'] = ['config/database_sysconfig.yml']
end
namespace :db do
task :migrate => :set_custom_db_config_paths do
Rake::Task["db:migrate"].invoke
end
...
end
end
This takes all the migrations in the db_sysconfig/migrate folder and deploys them to the SysConfig database. However, I am struggling to work out how to set up this task in the deploy.rb file for Capistrano, for when I deploy to staging/production. Does anyone know how I can set the application config paths in capistrano?
Capistrano '2.15.4' Rails '4.0.2' Ruby '2.1.0'