ActiveRecord comes with a method touch which sets the updated_at timestamp to the current time. Unfortunately it also runs...
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...
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...
You can find ActiveRecord models by using a Range as its conditions: User.scoped(:conditions => { :id => 3..5 }) This will generate...
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...
MySQL's MIN and MAX functions are for aggregations only. This will not work and produce an error:
If you use a form (or form fields) multiple times inside one view, Rails will generate the same id attributes...
Note: For PostgreSQL you should use advisory locks. For MySQL we still recommend the solution in this card.
This note is a reminder that there is something called AppArmor that could cause weird errors ("File not found", "Can...
On 32bit systems, the maximum representable Time is 2038-01-19 03:14:07 in UTC or 2038-01-19...
Have a backup. Stop MySQL: sudo service mysql stop Move (or copy) your mysql directory. If you want /mnt/mysql to...
To test whether two arrays have the same elements regardless of order, you can use the =~ matcher in RSpec < 2.11...
Sometimes you want to run a command forever, e.g. to compile a haml to html file on the console. Use...
When you try to remove a non-existing index using remove_index, the migration will incorrectly pass without an error...
A check if two date or time ranges A and B overlap needs to cover a lot of cases:
This might be due to AppArmor denying the MySQL server access to most of the filesystem. You can instead use...
There are times when you need to send SQL to the database, like this: def self.some_count(field) field = connection.quote...
I love ETags, but there’s something that annoys me: most implementations revolve around pulling a record out of a...
In regular expressions you can use the zero-width pattern \b to match the beginning or end of a word...
If you need to export data from MySQL to a CSV, you can profit from really fast built-in methods...