This is a visualization of the files that will be generated by some useful rails generators. Invoke a generator from...
Like you know from "How to tell ActiveRecord how to preload associations (either JOINs or separate queries)", you can tell...
When you're writing specs for ActiveRecord models that use memoization, a simple #reload will not do: it 'updates on...
Closure_tree lets your ActiveRecord models act as nodes in a tree data structure. This promises a few improvements over...
Instantiating ActiveRecord objects comes expensive. To speed up things, you can choose a more direct way to talk to your...
When working with custom transactions and use ActiveRecord::Rollback you may encounter unexpected behaviour if you try to roll back...
#reverse_order does not work with complex sorting constraints and may even silently create malformed SQL for rails < 5.
Rails 5 / 6 / 7 Method Uses Default Accessor Saves to Database Runs Validations Runs Callbacks Updates updated_at/updated_on Respects Readonly...
Detect if a gem has been activated A gem is activated if it is either in the current bundle (Gemfile.lock...
We have released a new library Gemika to help test a gem against multiple versions of Ruby, gem dependencies and...
Rails 5 migration classes look like this now: class CreateUsers < ActiveRecord::Migration[5.0] Mind the [5.0] at the end.
ActiveSupport::Notifications provides an instrumentation API for Ruby. It is used throughout rails to publish instrumentation events that include information...
We have a new gem Minidusen which extracts Dusen's query parsing and LIKE query functionality. Minidusen can no longer...
Sometimes you want to test migrations with production or staging data. Dumping single tables makes sense if a complete dump...
To check the currently running PG version from your Rails application (e.g. Rails console on your production server), simply do...
When your controller action raises an unhandled exception, Rails will look at the exception's class and choose an appropriate...
Resources Rails Guide: Internationalization API Guide to localizing a Rails application Locale-aware helpers in ActionView::Helpers::NumberHelper
Apparently you can pash a second scope to a hash-condition and the whole thing will be evaluated as a...
This is quite an edge case, and appears like a bug in Rails (4.2.6) to me. Update: This is now...
When ActiveRecord child objects are autosaved in Rails.
to create a Gallery that has a name and has_many :images, which in turn have a...
When you run rake db:rollback and nothing happens, you are probably missing the latest migration file (or have not...
Adds missing native PostgreSQL data types to ActiveRecord and convenient querying extensions for ActiveRecord and Arel for Rails 4.x...
ActiveRecord offers an explain method similar to using EXPLAIN SQL statements on the database. However, this approach will explain all...