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

Adding seeds for testing and staging purposes: One map, several layers… #376

Open
wants to merge 4 commits into
base: feature-api-optimization
Choose a base branch
from

Conversation

ut
Copy link
Member

@ut ut commented Feb 18, 2025

… and places (refs #372)

Just (re)call $ rails db:seed

photo_2025-02-18_11-52-19

@ut ut requested a review from birtona February 18, 2025 10:54
@ut ut changed the base branch from main to feature-api-optimization February 18, 2025 10:59
@birtona
Copy link
Collaborator

birtona commented Feb 18, 2025

I could execute the seeds successfully on my machine, but there is no background map image loaded:

Bildschirmfoto 2025-02-18 um 12 52 36

@birtona
Copy link
Collaborator

birtona commented Feb 18, 2025

I could execute the seeds successfully on my machine, but there is no background map image loaded:

added a basemap, now it looks good:

Bildschirmfoto 2025-02-18 um 13 30 53

@birtona birtona requested a review from MarcusRiemer February 18, 2025 12:32


module DatabaseSeeding
Copy link
Collaborator

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",
Copy link
Collaborator

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?

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.

3 participants