TLDR: This card explains which threads and processes interact with each other when you run a Selenium test with Capybara...
tl;dr: Using has_many associations with a :through option can lead to lost or duplicate records. You should avoid...
On recent/fresh installations of Ruby 1.8.7 you may encounter this error why calling any bundled binary (or just bundle exec...
We've since created ActiveType which has a restricted subset of Virtus' features. It might be enough for your needs...
In Ruby, classes and modules are called constants. This card explains how Ruby resolves the meaning of a constant.
Modern IRB has time measurement built in. measure # Enable measure :off # Disable Custom Should your version of IRB not offer...
Before Rails 3.2.14, when supplying an invalid locale to I18n, it would fall back to its config.i18n.default_locale (which is...
What Rails version Within before_* Within after_* Cancel later callbacks Rails 1-4 return false return false Cancel later callbacks...
Ruby publishes security issues and MRI updates on ruby-lang.org. Unfortunately there is no straight-forward way to subscribe to these...
If you get a Quota error with OpenStack, it doesn't have to be what it tell. For example, I...
When I upgraded from 0.5.4 PDFKit deadlocked or crashed when an ApplicationController::RouteError occured. If this error happens only because...
Ubuntu 12.04 LTS x64, Ruby 1.8.7, Rails 2.13, PDFKit 0.5.4, Phusion Passenger Apache 2 I ran into this, when I...
Whenever you create a table from a database migration, remember to add updated_at and created_at timestamps to that...
A snippet of the carrierwave documentation You might come to a situation where you want to retroactively change a version...
If you need to enable NewRelic monitoring on certain machines within the same Rails environment, a simple solution is to...
Ubuntu has a package mysql-sandbox that lets you install multiple MySQL versions into your user home: Install mysql-sandbox...
Rails has always included a scaffold script that generates a default controller implementation for you. Unfortunately that generated controller is...
It is good programming practice to Don't Repeat Yourself (or DRY). In Ruby on Rails we keep our code...
Geordi 0.16+ supports running selenium tests with project-specific firefox versions. Just update the gem. It will still default to...
You might not know that Rails disables CSRF protection in tests. This means that if you accidentally forget to send...
Copy the attached file to features/support. This gets you a convenience method: Capybara.javascript_test? Is true for Selenium, capybara-webkit...
Chrome extension that shows all info from your rails log (like parameters, response times, view rendering times, DB requests) inside...
If you want to have routes that are only available in tests (e.g. for testing obscure redirects), you can use...
When writing Rails migrations to convert a string column to an integer you'd usually say: change_column :table_name...