-
Notifications
You must be signed in to change notification settings - Fork 260
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
Fix empty restrooms db during development #508
Fix empty restrooms db during development #508
Conversation
Fixes db being empty during development. Ensures restroom entries from `db/export.csv` are loaded.
A more-minimal change might be to keep
Edit: I have tested with the following commands, after deleting my local
I would go with either approach. |
I'm hoping to merge this soon (in whichever configuration of commands we decide to go with) since it makes manual testing easier. It would particularly make the set of pull requests we have queued up easier to test. |
Thanks for this! Some comments:
I think this is connecting to Google Api maps. When I run it, I get |
@btyy77c, thanks again for the informative feedback.
Sounds right. I had this in the back of my head, but I don't think we've drop the
I wish I knew this with high confidence. But I have the sense we are not using Docker whatsoever in production. Production is a Heroku instance. I believe in that environment we get a minimal Linux "slug" that is able to then install ruby and our Gemfile and nodejs dependencies, etc. and generally run through our config files to set up a "native"-like Rails app on "bare" (virtual) metal. As in, no Docker or Vagrant etc. Here is a file that I believe means there are three separate databases: one for development, one for testing, and by process of elimination, one for production (the "default" db): https://github.com/RefugeRestrooms/refugerestrooms/blob/develop/config/database.yml Much of our app, especially as it pertains to Heroku, is set up roughly according to these guidelines: https://devcenter.heroku.com/articles/getting-started-with-rails5
I believe this is an inconsequential quirk/bug in our configs. I haven't seen this cause problems for us. I hope/presume it isn't actually counting against our quota. But other than that, this has felt safe to ignore. It would be nice to get rid of those warnings so people don't think something is going wrong, though. (And the reason this isn't a big deal is that the entries we are loading at that point, from At bare minimum, I' going to switch this pull request to not use |
`rake` commands are deprecated, and are being rolled into the `rails` command. See: https://guides.rubyonrails.org/v4.0/command_line.html#rake (rails 4.0) vs https://guides.rubyonrails.org/v5.0/command_line.html#bin-rails (rails 5.0) vs https://edgeguides.rubyonrails.org/command_line.html#command-line-basics (rails next) (Also moves away from `bundle exec`, which is unnecessary in this case.)
This LGTM @DeeDeeG, let's merge it asap since it seems like this is causing you and other people issues. |
Alright. Testing with the latest commit locally just to be sure this works, then will merge. I think our test environment (and our tests themselves) don't need the edit: so for the moment this PR is mostly not able to trip up CI, but CI also isn't telling us anything useful about this being a good PR or not. |
Awesome. Thanks @DeeDeeG |
* setup/entry: Use different command to seed db Fixes db being empty during development. Ensures restroom entries from `db/export.csv` are loaded. side note: command now uses `rails`, not `rake`. `rake` commands are deprecated, and are being rolled into the `rails` command. See: https://guides.rubyonrails.org/v4.0/command_line.html#rake (rails 4.0) vs https://guides.rubyonrails.org/v5.0/command_line.html#bin-rails (rails 5.0) vs https://edgeguides.rubyonrails.org/command_line.html#command-line-basics (rails next)
* setup/entry: Use different command to seed db Fixes db being empty during development. Ensures restroom entries from `db/export.csv` are loaded. side note: command now uses `rails`, not `rake`. `rake` commands are deprecated, and are being rolled into the `rails` command. See: https://guides.rubyonrails.org/v4.0/command_line.html#rake (rails 4.0) vs https://guides.rubyonrails.org/v5.0/command_line.html#bin-rails (rails 5.0) vs https://edgeguides.rubyonrails.org/command_line.html#command-line-basics (rails next)
Fixes db being empty during development.
Ensures restroom entries from
db/export.csv
are loaded.Context
bundle exec rake db:setup
command from the old Vagrant configurations.Summary of Changes
db:create
anddb:migrate
commands insetup/entry
bundle exec rake db:setup
Checklist
Screenshots
Before
After