-
Notifications
You must be signed in to change notification settings - Fork 3
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
Adding seeds for testing and staging purposes: One map, several layers… #376
base: feature-api-optimization
Are you sure you want to change the base?
Conversation
…s and places (refs #372)
|
||
|
||
module DatabaseSeeding |
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.
Langer Nitpick vorraus:
Warum braucht es hier ein Modul mit einer Klasse, welche nur aus self
Methoden besteht? Grundsätzlch sollten Module und Klassen in der von Rails vorgesehenen Ordnerstruktur abgelegt werden und das ist hier nicht der Fall.
Hintergrund: Ihr arbeitet augenscheinlich noch mit dem :classic
Loader aus Rails 5.1. Mit Rails 7 ist der nicht mehr verfügbar, dann gibts nur noch den wesentlich schnelleren (und strikteren) Zeitwerk Loader: https://guides.rubyonrails.org/v7.0/classic_to_zeitwerk_howto.html
Solange die referenzierten Klassen in der Gleichen Datei sind wird sich auch Zeitwerk nicht daran verschlucken, aber es wird über unerwartete Namen in unerwarteten Dateien warnen. Und in diesem konkreten Fall kann man ja auch mit "normalen" Funktionen für das Seeding gut leben?
"credits": "", | ||
"image_link": null, | ||
"color": "#93d3ec", | ||
"created_at": "2020-03-28T18:50:44.000Z", |
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.
Ist mir gerade noch aufgefallen: warum gibst du bei der map und dem layer die Timestamps mit, statt sie von Rails automatisiert setzen zu lassen?
… and places (refs #372)
Just (re)call
$ rails db:seed