customink / secondbase

Seamless second database integration for Rails.
MIT License
220 stars 31 forks source link

Descriptions for Rake tasks #60

Closed roolo closed 5 years ago

roolo commented 5 years ago

(To show them in project using this gem)

The changes other than descs are coming from running commands from Contributing section in README

metaskills commented 5 years ago

The original intent was not include these because we did not want to promote their explicit usage. Rather, you should run the Rails documented commands and these run silently in the background. But it may be hard to make these show up only when run_with_db_tasks is set to false. That said, I like how adding the desc raises the ones we explicitly call out in this section (https://github.com/customink/secondbase#database-tasks) like db:second_base:migrate:redo.

So all in all I think this is fine, but will bring on confusion when run_with_db_tasks is set to true. Do you think it is possible to add a unless SecondBase::Railtie.config.run_with_db_tasks (pseudo code) to the descriptions the task we do automatically?

roolo commented 5 years ago

@metaskills The original intent was not include these because we did not want to promote their explicit usage. Rather, you should run the Rails documented commands and these run silently in the background. But it may be hard to make these show up only when run_with_db_tasks is set to false. That said, I like how adding the desc raises the ones we explicitly call out in this section (https://github.com/customink/secondbase#database-tasks) like db:second_base:migrate:redo.

So all in all I think this is fine, but will bring on confusion when run_with_db_tasks is set to true. Do you think it is possible to add a unless SecondBase::Railtie.config.run_with_db_tasks (pseudo code) to the descriptions the task we do automatically?

For the linked tasks from README

First section

screenshot 2018-12-06 at 14 40 37 Tasks are documented and these show up only when config.second_base.run_with_db_tasks = false, in rake -T

Second section

screenshot 2018-12-06 at 14 41 11 Tasks are documented and these show up no matter what in rake -T

Other

Tasks are documented, but the descs are commented

metaskills commented 5 years ago

Thanks for merging @roolo! And more so for making those changes to conditionally show the desc based on the run_with_db_tasks boolean. I'll do some work to update the CHANGELOG and version and quickly look thru other issues to see if anything should go into the next gem release.