blog.mastermind.dev

I found the linked article very helpful to refresh my understanding of database indexes. As a small bonus, it includes...

Capybara has a variety of finder methods like find_button to help you look up DOM elements. There are also...

Usually you add errors to :base in ActiveRecord, in case no appropriate attribute could be used to add the error...

Maintaining larger projects makes it more difficult to balance refactoring and upgrade tasks according to its actual value. Consider to...

Let's say we have posts with an attribute title that is mandatory. Our example feature request is to tag...

By default most exceptions in Rails will render a 500 error page and will create a new issue in your...

Rails Active Support provides some helpful methods for calculating times and dates, like Duration#ago or Duration#from...

Rails offers the fresh_when method to automatically compute an ETag from the given record, array of records or scope...

By activating strict_loading you force developers to address n+1 queries by preloading all associations used in the index...

The change_column method for rails migrations support casting with a custom SQL statement. This allows us to change a...

This is a checklist I use to work on issues. For this purpose I extracted several cards related to the...

In the past we validate and set default values for boolean attributes in Rails and not the database itself.

Carrierwave's BaseUploader can have some validations that you can use by overriding a certain method, which's expected name...

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

geekytidbits.com

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

When you use the :as option to map a power to a controller method you can now override the generated...

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

I recently enjoyed debugging a Cucumber step that tried to be retryable using a patiently block: Then /^"([^"]*)" should( not)? be...

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

Our CI setup frequently sees this error while running yarn install: yarn install v1.22.19 [1/4] Resolving packages... [2/4] Fetching packages...

In a Jasmine spec you want to spy on a function that is imported by the code under test. This...

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...