Short reference on how to quickly debug the vanilla Rails job adapters. Queue Adapters by Environment Environment Adapter

Sometimes you have a maintenance script where you want to iterate over all ActiveRecord models. Rails provides this out of...

When creating a database table for a join model without further importance, you can use Rails' create_join_table:

When your Rails application is using Redis as its cache store, this is how you can list existing keys:

When you replace parts of the DOM with new HTML, using .innerHTML = newHtml is usually the simplest and fastest option...

Most of the time, it's a good default to add a unique index on the foreign key when using...

makandra dev

Enable local logging for Sentry when: Debugging Sentry event capture locally Testing error handling without polluting production metrics Developing background...

Full-text search can reach its limits in terms of flexibility and performance. In such cases, trigram indexes (pg_trgm...

unpoly.com

Quick reference for passing data from Rails to JavaScript via Unpoly compilers. Haml Attribute Syntax # Ising hash rockets and string...

In Rails 8 the behavior of the rails db:migrate command has changed for fresh databases (see PR #52830).

GoodJob and ActiveJob rescue exceptions internally, preventing exception_notification from triggering. This can cause silent job failures.To get notified, subscribe...

makandra dev

Rails log files rotate automatically when they reach approx. 100MB: $ ls -lh log/ -rw-r--r-- 1 user group 55M...

If you run a Rails app that is using Turbo, you might observe that your integration tests are unstable depending...

Most of the time, when you are interested in any log output, you see the logs directly on your console...

Coverage reports are rarely useful if you run only small parts of your test suite. Just do not load SimpleCov...

makandra dev

When RSpecs runs the first feature spec, you may see log output like this: Capybara starting Puma... * Version 6.5.0, codename...

ActiveRecord computes table names of model classes, and results are usually just like you'd expect. Adding a prefix for...

Currently we often use geordi to run cucumber and rspec tests. Geordi takes care of installing a matching chromedriver for...

api.rubyonrails.org

In Rails 7.2. the feature ActiveRecord.after_all_transactions_commit was added, for code that may run either inside or outside...

In Rails 7.2 the new default for config.action_dispatch.show_exceptions is rescuable. :rescuable: It will show a Rails error page in...

docs.sentry.io

You can report CSP violations to Sentry. Within config/initializers/content_security_policy.rb: Rails.application.configure do config.content_security_policy do |policy| # Settings for the policy...

reinteractive.com

The linked article shows how to configure omniauth-multi-provider to support multiple SAML identity providers for a single Rails...

makandra dev

If you need dummy data to play around with in development, it's often faster to reuse your existing factories...

When you want to filter records in a model where a string column roughly matches a given term, you can...