Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn to seed the database when no Developer records in development #494

Merged
merged 2 commits into from Jun 16, 2022

Conversation

bensheldon
Copy link
Contributor

@bensheldon bensheldon commented Jun 14, 2022

Connects to #472; broken out of #484 .

Adds a warning when in the Rails Development environment and the database has no Developer records to seed the database.

Screen Shot 2022-06-15 at 5 52 52 PM

@bensheldon bensheldon mentioned this pull request Jun 14, 2022
3 tasks
Copy link
Owner

@joemasilotti joemasilotti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor requests and we are good to merge!

@@ -41,6 +41,7 @@

<!-- Paginated list of developers -->
<div class="col-span-12 md:col-span-9">
<%= render Developers::UnseededWarningComponent.new(seedable: Rails.env.development?) %>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this to app/views/shared/_main.html.erb:2 so it shows up on every page.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


test "hidden when seedable but developers exist" do
render_inline UnseededWarningComponent.new(seedable: true)
assert_no_text("Run bin/rails db:seed")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's consolidate using parenthesis or not for these assertions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. I removed them to be consistent 👍

@bensheldon
Copy link
Contributor Author

@joemasilotti I've updated this PR based on your feedback. Looking sharp

Screen Shot 2022-06-15 at 5 52 52 PM

@joemasilotti joemasilotti merged commit 67ab9fa into joemasilotti:main Jun 16, 2022
5 checks passed
@joemasilotti
Copy link
Owner

Excellent - thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants