Repository navigation
Events stored in the database instead of YAML files - steps 1-8 - #487
kcomandich wants to merge 22 commits into
Conversation
c8b6c90 to
0b8ef91
Compare
mcgain
left a comment
There was a problem hiding this comment.
Bunch of nit-picking sorry, but they are worth addressing
1e2f75e to
2360201
Compare
800ec75 to
50eb16d
Compare
50eb16d to
db5f7c4
Compare
|
@kcomandich, just checking, is this ready to be merged or are you still working on it before you want it merged? |
This should be ready to be merged. There is more to do for the feature but I’ll open up new PRs for further work. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical migration and edit-route failures, along with unresolved data scoping and rendering issues, block approval.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (9)
Avoid calling slice on venue value objects · New Use collection route for edit page navigation · New Filter Melbourne events by region and type · New Scope homepage events to Melbourne and intended type · New Use database event route for Open Graph URLs · New Do not store rich text HTML in plain description column · New Do not render registration link without a URL · New Display each event's actual schedule times · New Avoid rendering speaker names twice · New
What changed in this PR
This draft moves Melbourne events from YAML to database-backed models and adds meetup-admin CRUD functionality.
Changes:
- Adds event, talk, venue, migration/import logic, factories, and tests.
- Adds database-event routes, controllers, presenters, views, and homepage.
- Adds meetup-admin authorization, seeds, styling, and documentation.
| File | Description |
|---|---|
spec/models/user_spec.rb |
Tests meetup-admin scope. |
spec/models/talk_spec.rb |
Tests talk behavior. |
spec/models/database_event_spec.rb |
Tests database event behavior. |
spec/factories/venue.rb |
Adds venue factory. |
spec/factories/user.rb |
Adds meetup-admin trait. |
spec/factories/talk.rb |
Adds talk factory. |
spec/factories/database_event.rb |
Adds database event factory. |
sites/melbourne/spec/requests/events_controller_spec.rb |
Updates event request coverage. |
sites/melbourne/spec/requests/database_events_controller_spec.rb |
Tests database event CRUD and authorization. |
sites/melbourne/spec/presenters/database_event_presenter_spec.rb |
Tests presenter behavior. |
sites/melbourne/config/routes/melbourne.rb |
Adds database event routes. |
sites/melbourne/app/views/melbourne/database_events/show.html.erb |
Displays database event details. |
sites/melbourne/app/views/melbourne/database_events/new.html.erb |
Adds new-event page. |
sites/melbourne/app/views/melbourne/database_events/index.html.erb |
Lists database events. |
sites/melbourne/app/views/melbourne/database_events/edit.html.erb |
Adds edit-event page. |
sites/melbourne/app/views/melbourne/database_events/_talk.html.erb |
Renders talks. |
sites/melbourne/app/views/melbourne/database_events/_form.html.erb |
Provides event form. |
sites/melbourne/app/views/melbourne/database_events/_database_event.html.erb |
Provides event card partial. |
sites/melbourne/app/views/melbourne/database_events_home/show.html.erb |
Displays database-backed homepage. |
sites/melbourne/app/views/melbourne/database_events_home/_no_upcoming_summary.html.erb |
Provides empty-state content. |
sites/melbourne/app/views/melbourne/database_events_home/_next_event.html.erb |
Renders the next event. |
sites/melbourne/app/views/melbourne/database_events_home/_header.html.erb |
Provides homepage header. |
sites/melbourne/app/views/layouts/melbourne/application.html.erb |
Loads Action Text assets. |
sites/melbourne/app/presenters/event_presenter.rb |
Formats database event presentation and metadata. |
sites/melbourne/app/controllers/database_events_home_controller.rb |
Loads database-backed homepage events. |
sites/melbourne/app/controllers/database_events_controller.rb |
Implements database event CRUD. |
db/seeds/users.rb |
Seeds meetup-admin access. |
db/schema.rb |
Records event-related schema changes. |
db/migrate/20260721021825_create_events_and_import_from_yaml.rb |
Creates tables and imports YAML events. |
CONTRIBUTING.md |
Documents meetup-admin development access. |
app/models/venue.rb |
Adds venue model. |
app/models/user.rb |
Adds meetup-admin scope. |
app/models/talk.rb |
Adds talk model and parsing. |
app/models/database_event.rb |
Adds database-backed event model and scopes. |
app/helpers/meetup_admin_helper.rb |
Adds meetup-admin helper. |
app/frontend/stylesheets/melbourne_application.scss |
Loads Lexxy styling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
HashNotAdam
left a comment
There was a problem hiding this comment.
Sorry, I wrote most of this feedback a month ago, so I hope its all still relevant
…n Melbourne::Events
Add 'Edit' and 'Delete' buttons to database_events/show Add 'Add New' button to database_events/index
…event_presenter The times used to be hardcoded into the view, now they are in the database so they need formatting
… user is meetup_admin
…being hardcoded in the presenter
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
edb394a to
b293cd0
Compare
Event page: * Only show Youtube apology if talk is in the past It looks a bit unusual when an event hasn't happened yet but we're apologising for not having posted a recording * Remove duplicate speaker names Home page: * Use the next event's start and end time rather than hard coding it * Remove ununsed code checking for year_is_different_from_current_year?
* Descriptions will now be stored in the action_text_rich_texts rather than the events or talks tables. * When importing events from YAML and checking if a Talk is already imported, keep it simple and don't search for talk by description (Action Text makes it more complicated to search) * Action Text does not need to be sanitized, so remove the call to `sanitize` for the Talk description. In the meta tags, the description is converted to plain text which must still be sanitized: https://guides.rubyonrails.org/action_text_overview.html#rendering-rich-text-content https://api.rubyonrails.org/v8.1.3/classes/ActionText/Content.html#method-i-to_plain_text
* make Venues optional for DatabaseEvents - update the views to account for this * add a unique index to slug because it's used to identify event pages * set_seeds_meetup_admin was incorrectly defined within import_yaml_events method * generate an error if a Venue is destroyed that is associated with Event(s) * specify some foreign_keys
f714701 to
54dc052
Compare
Co-authored-by: Adam Rice <development@hashnotadam.com>
Instead of storing the date separately to the start_time, both in the database as postgres datetime types, merge them together into start_datetime.
… Talks and DatabaseEvents These records contain Action Text fields that aren't deleted otherwise, and when the migration is run again it causes an error.
|
This PR is ready to be merged. Can you merge it please @HashNotAdam or @leesheppard ? It won't cause any user-viewable changes because these are new inaccessible pages and the old pages aren't using the new database records. I've addressed all of the concerns raised, or created new issues for them to be resolved later. See details at the top of the page, which I've updated based on my recent changes. Next I'll work on:
Thank you!! |



Move events from a YAML file to the database, and provide a way to create/edit/delete events
There are a few remaining items to finish before it's ready to use, but I wanted to make sure I'm on the right track.
See discussion on #342. Implementation so far:
Note that UUIDs from the events.yml file don't appear to be used, LMK if they should be.
Still to do/fix:
Done
✅ fix: HTML is showing up in the description when saving it
✅ Remove the date field and create a date method that just uses start_time (no need to have duplicate date and start_time fields)
Thanks to @mcgain for advising! 🙏 🎉
Screenshots:
Clone of the Melbourne event/show page, using events table, with Edit and Delete buttons:
New/Edit Event form:
Clone of the Melbourne events page, using events table, with New button:
Clone of the Melbourne home page, using events table: