Announcement, of sorts
Balkan Ruby, the website, is a Ruby on Rails app we started at the end of 2023 so we can sell the 2024 conference tickets ourselves. The marketing part (what you see) was a simple, static site powered by plain ERB HTML templates and data in YAML files. That was good – you should always start with something simple. But, when we ran Balkan Ruby 2025 and Ruby Banitsa conf, at times simultaneously, we realized that the static files could only take us so far, and we needed a proper way to host multiple events. We've done this incrementally and now have a decent back-office to add events, lineups, ticket types, sponsorship packages, and more. It's not perfect yet, but it's getting better.
Around my birthday, I got the idea to offer a one-day promotional event and highlight it with a banner at the top of the website. We had a scrappy banner system before that worked, sort of. However, it was static, and now that we have all resources in a database, I decided it's time for this announcement system to become a first-class Balkan citizen.
[4]
Let's start with the data model. I wanted the announcements to be bound to an event, have a presentational message, and have only one active announcement per event. The "one announcement per event" is the interesting constraint of the domain. We can do it in application code, but this does not offer the same guarantees as a database constraint will. Databases support partial indexes nowadays (even SQLite, which we use), and that's where we can define this constraint.
[1]
To prevent the need for application code validations, I wanted to have a UI action that can only activate one announcement at a time. This UI constraint makes the code simpler – when we activate an announcement, we can deactivate the previous one, and because of the database constraints, we don't need to know which one this is. We can simply deactivate all announcements for the event and activate the new one.
[2]
And voila, an evening of code to produce a solid announcement system that fits my Balkan Ruby needs for years to come. Keep it simple, y'all!
[3]

Genadi Samokovarov
Organizer