In activerecord-7.0.4/lib/active_record/tasks/postgresql_database_tasks.rb
there is a run_cmd
private method that I would like to use. It is a trivial method that uses psql_env
which is also trivial. I’m writing a database dump rails rake task and will also write a database restore rails rake task.
Should I just make copy of the two methods since they are so simple? I could monkey patch (I think is the term) ActiveRecord::Tasks:PostgreSQLDatabaseTasks
but I’ve seen others frown upon that.