Tutorials




Rails 7 allows permitting numeric params | Saeloun Blog
In Rails, strong params provide an interface for protecting attributes from the end-user assignment. We can specify required attributes and neglect unnecessary attributes to be used in the Active model mass assignment. However, in Rails 6, there w...

How we automatically fixed thousands of Ruby 2.7 deprecation warnings | GitLab
To address this warning, the obvious, and boring solution was to simply add ** to the last keyword argument. For the most part, this is what we did. However, while this was under way, we also developed a RuboCop check that could detect, and automa...

PostgreSQL zero-downtime migration of a primary key from int to bigint (with Ruby on Rails specific notes)
A primary key integer field approaching overflow is a devops nightmare. We explain step by step to how we made the migration with zero downtime.You have an auto increment primary key int field and it’s nearing the maximum value for int: 2,147,483,...

Don't waste your time on assets compilation on Heroku | Arkency Blog
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 exper...


The In-depth Guide to ActiveRecord load_async in Rails 7
Rails 7 introduces ActiveRecord load_async API that runs SQL queries asynchronously in the background thread. This seemingly simple change of just adding a single new method that takes no arguments has profound implications for database layer inte...

Episode 3: String-Based Templates vs. DSLs: the Pros
In this episode, I break down the main conceptual difference between “string-based templates” such as ERB and “DSLs” such as Papercraft, the various options within each category, and some of the reasons you might want to choose one approach or ano...