#ruby

23 articles with this tag

Related Tags

  • 6 min read
    A week in Helsinki
    Last 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 read
    How an index made rendering slow
    I 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 read
    140 million rows later
    At 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 read
    The humble ActiveModel
    ActiveModel 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 read
    Keep 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 read
    How I stumbled upon Strada while forwarding an email
    I 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 read
    GraphQL file upload with Shrine
    At 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 read
    Function composition >> Ruby
    Last 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 read
    Best image uploader for Rails — Revisited
    Three 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 read
    RabbitMQ is more than a Sidekiq replacement
    I'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...