-
Notifications
You must be signed in to change notification settings - Fork 1
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
New readme #28
base: master
Are you sure you want to change the base?
New readme #28
Conversation
@@ -143,6 +143,8 @@ There isn’t any fancy backend to this yet, so you’ll just have to add Doctor | |||
>> phone_number: "02 9876 5432" | |||
>> ) | |||
|
|||
We've added some default contacts, the five we've currently got, to the db/seeds.rb file. This means that when the user runs rake db:setup, the database will already had the points of data declared in the seeds.rb file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't really the proper use for seed data. As I understand it, seed data should include things that don't change and are standard to the app, e.g. “Default data”. For example, if you had a project that included a list of nations as objects, you might include them as seed data because they are unchanging. This is so that the data remains separate from from app logic.
As I understand it, seed data shouldn't be stuff that will need to be updated or changed. You'd have to reload all the data whenever you want to make a single change. This is bad because it means that whenever we change the values for one of these doctors, we need to remember to change it in the seed data as well as the database. This would be very easy to forget.
The current proper way to add data is in the readme here https://github.com/JasonThomasData/DocLink#adding-doctors-to-the-database . It's quite manual, will take a minute to do, but is better and more flexible. If it takes too much time, maybe it's time to open an issue for automatically loading data out of the spreadsheet. Here's how you run commands like rails console
and rake
on the remote Heroku db https://devcenter.heroku.com/articles/rake .
But if you find this useful for now, keep it, but I think it's gonna become a pain in the bum ;-).
The Heroku instance you sent me didn't have any data on it, so I made a new Heroku instance. I was with Henare at the time of doing this and he saw our way of entering data, so he suggested doing this. I've already added the changes to master since I had to get data onto Heroku before I saw SSI. Master has two commits - one was to comment out the production details in the database.yml file that was making an issue for Heroku, the other is the seed thing. I'm pretty stoked I don't have to manually enter data via the Rails console actually. The spreadsheet option sounds great to me, let's do that! While I'm here, SSI have a bunch of requests so I'm about to open 6 or more issues now. |
Sounds reasonable to me 👍 Merge this I recon :) |
I had to add some stuff on Monday, the same day I met with SSI. So I've updated the readme to reflect these. Please let me know what you think when you can.