March 13, 2024

Setup a JS server in a minute

Sometimes we need a quick and dirty Javascript server running to try or debug some js -related stuff. You can use existing npm packages that do that but I personally prefer to understand what I'm doing and what's happening. Here's how to manually setup a JS server locally in a minute.

Read more
August 13, 2023

Wandering in CRuby - Introduction to objects and classes

This article is part of the series Wandering in CRuby

Read more
August 13, 2023

Wandering in CRuby

Ruby is a beautiful language and you probably know how to use it well, but do you know how it works? Let's dive into the Ruby MRI source code and find out how it really works.

Read more
April 26, 2023

Why RSpec executes after_commit callbacks even with use_transactional_fixtures

I used to believe that after_commit callbacks are not executed within RSpec tests when config.use_transactional_fixtures is set to true. Well, I was wrong. Here's why.

Read more
February 11, 2023

ActiveRecord: finally understand transactions

Database transactions are an essential tool to master. Because ActiveRecord's transactions behavior is not intuitive (especially when it comes to nested transactions), this article explains how to use them and what pitfalls you should pay attention to.

Read more
June 14, 2022

How to write a recursive SQL query

Let's see how to write a recursive SQL query with PostgreSQL's CTE (Common Table Expressions) and ActiveRecord

Read more
November 19, 2021

ActiveRecord: finally understand joins and left_outer_joins

If you never really understood how joins work, or if you're somewhat familiar with .joins but hardly grasp what .left_outer_joins does, this is the blog post you need.

Read more
November 15, 2021

How to add SSL to Ruby on Rails on localhost

It is not common to run a Rails application in development mode locally over SSL. This article explains how to do that.

Read more
November 10, 2021

My thoughts about parentheses in Ruby

This blog post summarizes my thoughts after reading one of David Brady's blog posts. It gives me the opportunity to talk about something that bothers me often during peer reviews: the dogmatic lack of parenthesis.

Read more
October 25, 2021

How to have UUID primary keys with PostgreSQL

Step-by-step tutorial on how to enable and use UUID primary keys in your Rails application

Read more
July 27, 2021

RSpec - make sure your seeds work!

A collegue shared this code snippet that helps making sure your database/models changes don't break your seeds.

Read more
July 26, 2021

How to hack with ransack

ransack is a 4.9k star gem that provides out-of-the-box search tools for your Ruby on Rails application. Let's find out how it can be hijacked to hack an app and extract data or steal users accounts.

Read more
December 13, 2019

rails/rails PR#37958 - Fixes typo in autoloading_and_reloading_constants guide

The javascript directory under app/ is in a singular form (app/javascript) but the documentation was mentionning it in the plural form (app/javascripts).

https://github.com/rails/rails/pull/37958/files

November 19, 2019

rails/rails PR#37753 - Add params.member? to mimic Hash behavior

StrongParameters delegates key? method for params to behave kind of like a Hash.
I suggest we delegate member? as well.

https://github.com/rails/rails/pull/37753/files

May 28, 2019

rails/rails PR#36324 - Fix unexpected select_tag delete behavior when include_blank is present

Fixes select_tag so that is doesn't change options when include_blank is present.

Fixes #36295

https://github.com/rails/rails/pull/36324/files

May 18, 2019

rails/rails PR#36282 - List available skip options in command line guide

Issues such as #36280 and #35484 are due IMHO to a lack of documentation regarding the skip options available when running rails new command. I suggest we add a list of options to the documentation.

https://github.com/rails/rails/pull/36282/files

April 21, 2019

rails/rails PR#36051 - Allow ActiveStorage to generate variants of BMP images

Allow ActiveStorage to generate variants of BMP images.

Fixes #35953

https://github.com/rails/rails/pull/36051/files

April 17, 2019

rails/rails PR#36010 - Mention more ActiveStorage hooks in Active Support Instrumentation guide

This PR adds the following three hooks that were missing in Active Support Instrumentation guide:

  • service_download_chunk.active_storage
  • service_update_metadata.active_storage
  • preview.active_storage

https://github.com/rails/rails/pull/36010/files

April 15, 2019

rails/rails PR#35906 - Notes tags registration

This PR adds to SourceAnnotationExtractor::Annotation a new method register_tags following the example of register_directories. It does not change the behavior of rake notes and allows tags registration through configuration.

https://github.com/rails/rails/pull/35906/files