-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
I am trying to use the PgBackup::Helpers::Database in a custom Capistrano task
require 'rake'
require 'pg_backup/helpers/database'
include PgBackup::Helpers::Database
namespace :database do
task :dev_backup do
on roles(:db) do
within current_path do
with rails_env: fetch(:environment) do
dump_dir = "#{shared_path}/#{fetch(:pg_backup_remote_dump_dir)}"
backup_file = "#{dump_dir}/dev_database.backup"
if !test("[ -d #{dump_dir} ]")
error "Folder '#{dump_dir}' does not exits!"
else
with_database_config do |host, db, user, pw|
` PGPASSWORD=#{pw} pg_dump --host #{host} --username #{user} --clean --format=c --no-owner --no-acl --exclude-table-data 'table' #{db} > #{backup_file} `
end
end
end
end
end
end
end
but looks like ActiveRecord constant is not loaded
uninitialized constant PgBackup::Helpers::Database::ActiveRecord
any hints about how to resolve this?
Thx.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels