When selecting records in a date range, take care not to do it like this: start_date = Date.parse('2007-05...

Basically, you now need to know if your project uses a "real" time zone or :local, and if config.active_record.time_zone...

The tagged_with scope comes with many awesome options to modify your search: User.tagged_with("awesome", "cool") # Users that are...

This might seem obvious, but I'm rejecting stories because of this on a regular basis. Whenever a list (e.g...

The SQL code generated by Graticule's spherical distance computation is insufficient and can lead to NULL distances in edge...

For performance improvements (and to remove the need for eager loading), the ActsAsTaggableOn gem supports caching your tag lists directly...

How to ignore new files Globally Add the path(s) to your file(s) which you would like to ignore...

When you have objects in your database that hold latitude and longitude and you want to find others that are...

Note: This applies specifically to MySQL. In PostgreSQL for example, this is not an issue. If you care about performance...

Look here for informations how you can show the MySQL default character set. At first you need the Amazon RDS...

To show the collation of your tables you have to login to the MySQL console and execute SHOW TABLE STATUS...

To show the MySQL default character set you have to login to the MySQL console and execute SHOW VARIABLES LIKE...

Given the problem you have a new column postion and that column should be updated for all existing rows with...

When adding a new field to your model's database table, don't set any defaults in the database.

In order to open a MySQL shell without the need to enter user and password, you can say the following...

In case you have sensitive data within your RDS instance, you want to use encrypted connections between your application and...

The technique described in this card has an important caveat: The result of GROUP_CONCAT is truncated to the maximum...

makandra dev

When you run rake db:create and get this error message Couldn't create database for {"encoding"=>"utf8", "username"=>"root...

makandra dev

Here is a way to create a duplicate of one database, with all its tables and their data, under a...

Observed on Rails 2.3 and machinist 1.0.6 Like the title says, when you define the method empty? like in the...

Simple: Tell the application controller how to handle exceptions, here a RecordNotFound error. Do this with the following line: # application_controller.rb...

While it might seem trivial to implement an invoice that sums up items and shows net, gross and vat totals...

This is a bug in Timecop 0.3.4 or lower. You should upgrade to 0.3.5.

When the Ruby parser module of Ruby-GetText comes across a file in one of its search directories (e.g. lib/scripts...