The information in this card is only relevant for Rails 2.3-era apps. This note gives a quick introduction into...
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...
The shell variable PS1 holds your bash prompt. You might want to change it to serve your needs best. Here...
Add deprecation warnings and their solution or link to available solutions. Global access to Rake DSL methods is deprecated. Please...
Pie sometimes does not properly redraw elements upon changes. This often happens when the change comes from somewhere further up...
JavaScript Garden is a growing collection of documentation about the most quirky parts of the JavaScript programming language. It gives...
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...
Depending on where you live, different rules are used to determine the number of the week and a weekday. You...
You can find ActiveRecord models by using a Range as its conditions: User.scoped(:conditions => { :id => 3..5 }) This will generate...
track down warnings and to see failing specs immediately or to get an overview of the core...
You will occasionally need to clean out your database while keeping the schema intact, e.g. when someone inserted data in...
When you click a link or a press a button on a Selenium-controlled browser, the call will return control...
When you set both a record's association and that association's foreign key attribute, Rails does not realize you...
Note: For PostgreSQL you should use advisory locks. For MySQL we still recommend the solution in this card.
When you have a Cucumber step like Then I should see "Did you see those \"quotation marks\" over there...
On 32bit systems, the maximum representable Time is 2038-01-19 03:14:07 in UTC or 2038-01-19...
This tool is used on our application servers (and called when deploying) but it also works locally. Just call dumple...
To test whether two arrays have the same elements regardless of order, you can use the =~ matcher in RSpec < 2.11...
The code below shows a method #validate which uses Nokogiri to validate an XML document against an XSD schema. It...
Note that this sounds good but is not good at all when hooking tasks on cap deploy (see this article...