Since Rails 7 you are able to encrypt database information with Active Record. Using Active Record Encryption will store an...

Sometimes I ran across a GitHub merge request of a gem where it was not completely obvious in which version...

geekytidbits.com

To retrieve only unique combinations of the selected attributes: You can omit rows, where all selected columns are equal with...

Let's assume that we have a model Movie that registers a callback function when a new instance of Movie...

kukicola.io

Using ActiveRecord's #signed_id and .find_signed methods you can create URLs that expire after some time. No conditionals...

When an object is created / updated, various callbacks are executed in this order: before_validation after_validation before_save

makandra dev
ruby-doc.org

TLDR if you define a equality method for a class you must also implement def hash. Ruby has a lot...

The cards editor has a feature "Cite other card" to create links to other cards in the same deck as...

tl;dr You should decouple migrations from models by embedding models into the migration. To use STI in this scenario...

Jasmine specs for the frontend often need some DOM elements to work with. Because creating them is such a common...

blog.logrocket.com

Variable fonts are popular for two reasons: they expand design possibilities and improve website performance. While the former statement is...

tl;dr The Chrome DevTools are a neat collection of tools for the daily work as a web developer. If...

github.com

ActiveType::Object inherits from ActiveRecod::Base and is designed to behave like an ActiveRecord Object, just without the database...

Unpoly's [up-observe], [up-autosubmit] and [up-validate] as well as their programmatic variants up.observe() and up.autosubmit...

tl;dr Since Rails 7+ you can use ComparisonValidator for validations like greater_than, less_than, etc. on dates, numerics...

Here are a few common patterns that will probably lead to flaky specs. If you notice them in your specs...

wpostats.com

Case studies and experiments demonstrating the impact of web performance optimization (WPO) on user experience and business metrics.

To allow HTTP 304 responses, Rails offers the fresh_when method for controllers. The most common way is to pass...

For Rails models where only one of multiple attributes may be filled out at the same time, there is no...

greg.molnar.io

Greg Molnar has written a neat article about creating a single-file Rails app. This is not meant for production...

When working with feature branches, stale branches pile up over time. It's best to remove them right after merge...

Recently we detected a memory leak in one of our applications. Hunting it down, we found that the memory leak...

paweldabrowski.com

The linked content includes a few design patterns implemented with Ruby on Rails. What is the card indented to achieve...

SELECT pg_size_pretty(pg_database_size('some-database')); Example SELECT pg_size_pretty(pg_database_size('cards_p')); ----------------