backup/backup

Recommended way to use with Rails applications

ciembor opened this issue · 1 comments

Hello. I'm going to write a tool that makes and loads a dump of a database everytime when someone changes branch in Rails (with bundler) environment. I know it's not recommended to use backup as a dependency for rails application. And I'm going to use backup as a dependency of my gem. What would be the recommended way to use it in such case? I can ask people to use my gem as a global, as well as backup, but I need to get information about rails settings (config/database.yml) when running the command in any of rails app directory.

Hello @ciembor,

The honest answer is that I would not recommend using Backup at all for what you are describing. Backup is a lot of code, with a lot of features, and it is no longer actively developed.

Your use case is quite specific, so I would suggest building a minimum viable solution. If you are building this just as a solution for yourself or your company, I would actually suggest starting by figuring out how to run a Rake task when the user changes branches, and then add a couple of Rake tasks to do what want. If you read the code in Backup, you will probably find that you can write simpler implementations.