Stop concatenating URLs with strings — Use proper tools instead

At first glance, it looks harmless, but it hides several traps that can lead to hard–to–debug errors.

Installing Precompiled Native Gems with bundle lock --add-platform

There's a great chance that your Ruby app occasionally explodes during bundle install because of native extensions. There's an even greater chance that it happens with nokogiri, ffi or some other notorious gem with C extensions. The problem gets worse when you're working across different operating systems or upgrading Ruby versions. Let's fix this once and for all.

Rails: when "nothing changed" is the best feature

Recently, I had a chat with a friend of mine, who used to do Rails back in the days. For the last ~10 years he’s focused on mobile development. I was curious what are his observations and asked if he’s happy with his decision or maybe he actually misses web development.

How to add index to a big table of your Rails app

When your application is successful, some of the tables can grow pretty big — I’m looking at you users table. If you’re curious enough, you periodically check how your database performs. If any slow query pops up in the metrics, there’s a great chance that some index is missing.

Replace aasm with Rails Enum today

There’s a great chance that your Rails app contains one of the gems providing so called state machine implementation. There’s even a greater chance that it will be aasm formerly known as acts_as_state_machine. Btw. Who remembers actsashasselhoff? — ok, boomer. The aasm does quite a lot when included into your ActiveRecord model — the question is do you really need all those things?

The most underused pattern in Ruby

Recently one of the RailsEventStore users posted an issue that one wanted to use RES on a Postgres database with PostGIS extension. Migration generator used to setup tables for events and streams was failing with UnsupportedAdapter error.

How to become 10x developer with a help of ChatGPT

Is being a 10x developer still a thing? Trends change, currently there's a lot of chatter around whether LLMs will take our jobs, sorry couldn't stand this South Park reference.

How to write a good incident postmortem

Sometimes, not everything goes smooth when introducing changes in your application. When it happens, you introduce hotfix as soon as possible, usually followed by the coldfix. Such situations are great to take a learning from.

First class json(b) handling in Rails Event Store

Recently, in Rails Event Store v2.8.0 PreserveTypes transformation has been introduced. v2.9.0 release brought RailsEventStore::JSONClient. It's a set of great improvements for RES users who plan to or already use PostgreSQL with jsonb data type for keeping events' data and metadata.

Sometimes it's worth to test your framework features

Rails 6 introduced upsert_all which was a great alternative to raw SQL for inserting or updating multiple records at once. There were gems providing this feature for earlier versions of Rails like activerecord-import, it did a great job in Rails Event Store.

How we got struck by 5–year–old implementation

Recently we discovered that we were wrong on computing lock key for acquiring advisory locks. It was already covered as an update to article about building read models, but we thought that telling the whole story behind the issue could be interesting for you.

Test which reminded me why I don't really like RSpec

— Feel free to review it, it's written by one of our juniors and I need to give him some feedback soon. — he responded.

Don't waste your time on assets compilation on Heroku

At some point, you may want or be forced to use the CDN to serve assets of your Rails app. When your app is globally available, you may want to serve the assets from strategically located servers around the world to provide the best possible experience for the end user. Serving static assets via Puma is not the best idea — it'll be slow. The only viable option on Heroku is to use CDN. I will show you how to do it smart, save time and have faster deployments

A lesser known capability of Ruby's JSON.parse

If you ever got annoyed by the fact that JSON.parse returns hash with string keys and prefer hashes with symbols as keys, this post is for you.

Fighting the primitive obsession with Value objects

My previous post on read models intended to address something different, but I decided to focus on read model part and leave the other topic for a different one. There's one thing which I dislike in the implementation. Using primitives to calculate the scores.

How to build a read model with Rails Event Store Projection

Recently I faced interesting challenge in one of our customer's application. Imagine that you take a test after which you get a personalised reports about your skills level. Existing mechanism for that was time and resource consuming. People had to wait for e-mail delivery with PDF-generated report several hours due to several constraints, which I would prefer not to dive into.

Use ActiveAdmin like a boss

ActiveAdmin is widely used administration framework in Rails applications. This post explains how to hook more sophiscicated domain logic into it.

Stop making excuses and write tests

Recently on Clubhouse – so hot right now – I took a part in discussion about How programming languages influence the way we test software. The room was held in Polish under 🇵🇱 Dev Radio PL label. There were a mix of people with different backgrounds attending — backend developers, frontend developers and mobile ones.

Painless Rails upgrades

Sooner or later your Rails application will require an upgrade of the framework itself. There are many reasons behind that. Bugs, incompatibility with modern libraries, or the worst: the version you use will no longer receive security updates. Living on the edge might be tempting, but it can also end badly for the business which relies on the application. User data leak, frauds, this all can simply lead to serious legal and financial issues.

Ultimate guide to 3rd party calls from your Aggregate

If you ever wondered how to make 3rd party API call from Aggregate and not clutter it with dependencies, you may find this post interesting.

Image Placeholder for your development environment

Some time ago I was working together with Paweł on one of our clients web application. We used copy of products catalog coming from production server on our development machines. What we were lacking were product photos, causing application layout to look poorly and making any css job hard. We tried to find a smart solution for that case.

Make your JSON API tests clean with linter

Recently, one of our customers requested that mobile devices should communicate with backend via JSON API. We started implementing an endpoint for registering customers.

Composable RSpec matchers

While developing RSpec matchers for RailsEventStore we figured out that in some cases it would be good to compose multiple matchers together.

How to setup development work with RailsEventStore and mutant

As Arkency we’re making our efforts to inculcate Domain Driven Design into Rails community. You should be familiar with Rails Event Store ecosystem. We use it in our customers’ projects with success since quite some time.

What taking care of your teeth has in common with programming?

I don’t need to tell you why brushing your teeth and going to a dentist with a regular time manner is an important thing.

Test critical paths in your app with ease thanks to Dependency Injection

Dependency Injection is one of my favorite programming patterns. In this short blogpost, I’ll present you how it helps testing potentially untestable code.

One more step to DDD in a legacy rails app

Recently I picked up a ticket from support team of one of our clients. Few months ago VAT rates have changed in Norway - 5% became 10% and 12% became 15%. It has some implications to platform users — event organizers, since they can choose which VAT rate applies to products which they offer to the ticket buyers. You'll learn why I haven't just updated db column.

The smart way to check health of a Rails app

Recently we added monitoring to one of our customer’s application. The app was tiny, but with a huge responsibility. We simply wanted to know if it’s alive. We went with Sensu HTTP check since it was a no-brainer. And it just worked, however, we got warning from monitoring tool.

How RSpec helped me with resolving random spec failures

Recently we started experiencing random spec failures in one of our customer’s project. When the test was run in an isolation, everything was fine. The problem appeared only when some of the specs were run before the failing spec.

A Simple feature toggle for a Rails app

You've probably heard before about feature toggle. Theory looks fine on the paper, but you’re possibly wondering how to implement such feature in your Rails app.

Sitemaps with a bit of Metal

Sooner or later, you will probably start taking care about your application's SEO, especially if it provides a lot of content and you want to be discovered by users in search engines results. There are several ways to do this in your Ruby app. You can create sitemap.xml file manually if there aren't very much urls, but it will become pretty ineffective when you have more than a dozen or so. There are some very neat tools which will do this for you out of the box, even if you need a lot of customization.

37 signals was not lying, you win by being remote

There is such moment in developer's life when you start looking for a new job, sooner or later. You can observe that even in Poland, there are plenty of Ruby on Rails job offers, often in very perspective companies. I probably could find interesting job in Poznań, where I live, but there were some presumptions which pushed me to apply to Arkency.