dry-rb / dry-web-roda

Roda integration for dry-web apps
MIT License
119 stars 22 forks source link

Fix Dry::System::InvalidComponentError on rake task(s) (db:create) #60

Closed modellurgist closed 7 years ago

modellurgist commented 7 years ago

This issue affects rake and might mask another error I'm investigating that also affects rake under the same conditions after the fix below.

Steps to reproduce

  1. Create a project via
gem install dry-web-roda -v 0.7.5
dry-web-roda new viableproduct
cd viableproduct
  1. Ensure the project-specific development and test databases do not exist in Postgres yet.

  2. Execute rake db:create

This yields the following error:

Dry::System::InvalidComponentError: Tried to create an invalid "settings" component - namespace +viableproduct+ not found in path

A fix

Finalizing the container in the Rakefile did the trick, but this might not be how/where you want to do this. I'm still getting familiar with the ecosystem and its norms. Thanks for all your efforts!

Note on tests

I didn't see any existing coverage for this, and I'm sorry I didn't include any. That's something I want to help with in some future contributions.

solnic commented 7 years ago

db tasks should not require a finalized container, they only need to init(:persistence) component /cc @timriley

timriley commented 7 years ago

This one should've been fixed in #64