ruby-doc.org

We will achieve this by creating a block accepting method to optionally create and then lock a .lock File of...

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

makandra dev

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.

HTTP header values must only contain low-ASCII (7-bit) characters for safe transport. From RFC 7230: Historically, HTTP has...

Not all email clients support external images in all situations, e.g. an image within a link. In some cases, a...

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

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

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

bundler.io

Bundler so far ignored the version specified under BUNDLED_WITH in the Gemfile.lock. This had two annoying consequences:

makandra dev

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

In esbuild, you usually import other files using relative paths: import './some-related-module' import `../../utils/some-utility-module` import `../../../css/some-css.sass` This is totally fine...

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

As a developer you may have many tools watching your project for changes: Your IDE, Webpack, Guard, etc. This is...

developer.chrome.com

Hide/Show Drawer You can press Escape to show/hide the drawer. Fast Navigation with Command Menu Use Ctrl + Shift + p to...

tl;dr In Chrome DevTools in the Layouts tab you have handy options to debug CSS Flexbox and Grid. Including...

sass >= 1.35.0 has the option quietDeps and silenceDeprecations to silence deprecation warnings from dependencies. quietDeps: No deprecation warnings for dependencies...

tl;dr In Chrome DevTools in the Sources tab you can activate Event Listener Breakpoints for debugging events. Example

tl;dr In Chrome DevTools in the Elements tab or in Firefox in the Inspector tab you can right click...

github.com

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