#ruby
23 articles with this tag
Related Tags
-
6 min readA week in HelsinkiLast Wednesday my girlfriend and I woke up at 4 AM and headed to the Zagreb Airport to catch a flight to Helsinki. I haven’t been in Helsinki since Junction 2016, but with EuRuKo 2022 (the European Ruby Konference - this is not a typo) being there this was the prefect opportunity to visit...
-
8 min readHow an index made rendering slowI noticed that a view I was working on was rendering much slower than I would expect it to. The view showed a list of events, together with the person that generated the event and the device that the event belongs to. It took nearly half a second to render 25 events, while other similar pages...
-
6 min read140 million rows laterAt work, as part of a project I’m working on, I wanted to add a new reference to a table. ”Simple enough” - I thought. Spoiler alert, it wasn’t. Adding a reference from one table to another is straight forward in Rails. You create a migration using rails generate and then write in it something...
-
4 min read“Having a monolith is a single point of failure”I recently took part in a discussion that brought to light the most unusual argument against having a monolith that I have ever heard - that a monolith is a single point of failure. I want to make clear that I consider monoliths and microservices neither good nor bad, or universally better or...
-
3 min readThe humble ActiveModelActiveModel is one of my most used tools in Rails applications. I use it in service objects, form objects and objects that represent external entities. Why? Because it provides a nice interface for validating inputs and results, it can have callbacks for pre and post-processing data, and it...
-
6 min readKeep it boring, don’t surprise me“I’ve spent a lot of my life worried that people will think I don’t know enough. Sometimes, that worry has made me use big words when I didn’t need to. –Randall Munroe in the foreword to the Thing Explainer” I used to be a stickler for organizing code by what it was. Models, decorators, form...
-
6 min readHow I stumbled upon Strada while forwarding an emailI wanted to forward an email one evening, so I opened up the Hey app on my phone, found the email, tapped on the “More” button, and just before I hit “Forward” I noticed a “Share or print…” button at the bottom of the screen. I hit “Share” and to my surprise was greeted by a share sheet. It...
-
6 min readGraphQL file upload with ShrineAt the moment of writing there is no officially supported way to do file upload through GraphQL. Here is a roundup of all available methods to do file upload through it, their pros and cons. This post grew out of a request on the Shrine issue tracker — you can find the original issue here. It's...
-
5 min readFunction composition >> RubyLast week Proc#<< and Proc#>> got merged into Ruby 2.6. This opens the door for function composition. Here’s my opinion as to why this is a great leap forward for Ruby and what needs to improve. Composition vs. inheritanceRuby is an object-oriented language (among others), meaning it has the...
-
7 min readBest image uploader for Rails — RevisitedThree years ago I wrote about how to choose the right uploader gem for your project. Since the time the original article has been published, all mentioned libraries got updated, one got deprecated, and two new libraries have appeared. I feel it's time to revisit this topic. Why do we use uploader...
-
13 min readRabbitMQ is more than a Sidekiq replacementI've had gripes with Sidekiq because of which I switched to RabbitMQ. Here are my thoughts and experiences after a year of using it in production. I got inspired to write this post by the overwhelming response I received for my talk at the local Ruby user group. Why do we need Sidekiq or...