When storing floating-point numbers such as prices or totals in an SQL database, always use a DECIMAL column. Never...
When deploying an application with "cap deploy" by default [1] you only deploy your code but do not run migrations...
Airbrake (formerly Hoptoad) already ignores certain errors like InvalidAuthenticityToken by default (see Airbrake::Configuration::IGNORE_DEFAULT).\ To ignore additional classes...
User Stories should describe what a user wants the system to do. Purely technical tasks should usually be implemented as...
We can now plug into every facet of the Rails jQuery UJS adapter, binding to custom events, and even customizing...
The Edge Rider gem will define a method collect_ids on your ActiveRecord models, scopes, integer scalars and collections, which...
Our new scope-based authorization gem for Ruby on Rails has been released. This might one day replace Aegis as...
ActiveRecord gives you the :include option to load records and their associations in a fixed number of queries. This is...
ActiveRecord models know how to cast a given string to the type of a given attribute (or column).
User.active.to_sql Rails 2 Use either the Edge Rider or fake_arel gem to get #to_sql backported...
Note: ActiveRecord::Base#becomes has a lot of quirks and inconsistent behavior. You probably want to use ActiveType.cast instead.
There is a nasty bug in all version of Rails 2 and some versions of Rails 3.x where two...
Within an event handler, there are multiple methods to cancel event propagation, each with different semantics. event.preventDefault() Only prevents the...
If you're using jQuery, you need to update to 1.5.1 to get Internet Explorer 9 to work.
When you write a custom RSpec matcher a good place to store them is to create one file per matcher...
When using ActionMailer, you can set an array of email addresses as recipients. If this array is generated by e.g...
If you just upgraded to Bundler 10.0.10 you might get the following error when bringing up Rails: /usr/lib/ruby/1.9.1/psych.rb:148:in...
Sometimes you can make your life easier by not allowing a record attribute to be changed after the record was...
ActiveRecord comes with a method touch which sets the updated_at timestamp to the current time. Unfortunately it also runs...
Specify these gem versions in your Gemfile: gem 'cucumber', '~> 1.3.0' gem 'cucumber-rails', '= 0.3.2' # max version for Rails 2
Sometimes you need to dynamically load an image and do something as soon as its loaded (when for example its...
Add deprecation warnings and their solution or link to available solutions. Global access to Rake DSL methods is deprecated. Please...
The attached RSpec matcher exist_in_database checks if a given record still exists in the database and has not...
When you need to insert many records into the same table, performance may become an issue. What you can do...