You can detect city and country from an IP address by using the GeoLite database. This is a flat file...

highscalability.com

Awesome battle report from Pinterest trying to scale their setup using different approaches. When you push something to the limit...

Rails gives you migrations to change your database schema with simple commands like add_column or update. Unfortunately these commands...

Caution when using .where to exclude records from a scope like this: # Fragile - avoid User.where("id NOT IN (?)", excluded_ids...

apidock.com

All columns of a model's database table are automagically available through accessors on the Active Record object.

blog.codeclimate.com

Rails’ reputation as a relatively secure Web framework is well deserved. Out-of-the-box, there is protection against many...

Do not pass times to date attributes. Always convert times to dates when your application uses time zones. Background

ariejan.net

Rails understands a :limit options when you create columns in a migration. Its meaning depends on the column type, and...

web.archive.org

TL;DR: You should generally use #size to count associated records. size Counts already loaded elements If the association is...

Here is a hacky way to load dumps directly from the source server, without fully copying them over and extracting...

mysqlperformanceblog.com

When MySQL refuses to use your index, there's a number of things that you may be doing wrong. One...

github.com

MongoMapper is a MongoDB adapter for Ruby. We've forked it so it works for Rails 2.3.x applications running...

makandra dev
rails-sqli.org

This page lists many query methods and options in ActiveRecord which do not sanitize raw SQL arguments and are not...

The Edge Rider gem gives your relations a method #traverse_association which returns a new relation by "pivoting" around a...

rubydoc.info

When you accept a table in your Cucumber step definition, that table object will have the cryptic type Cucumber::Ast...

validates_uniqueness_of is not sufficient to ensure the uniqueness of a value. The reason for this is that in...

The way MySQL's FULLTEXT tokenizer splits text into word tokens might not always be what you need. E.g. it...

TLDR: In tests you need to clean out the database before each example. Use :transaction where possible. Use :deletion for...

When searching for text in a MySQL table, you have two choices: The LIKE operator FULLTEXT indexes (which currently only...

Our old solution for cronjobs, the "craken" plugin, is no longer maintained and does not work on Rails 3.2+.

ActiveRecord has a feature called counter caching where the containing record in a has_many relationship caches the...

In Rails 2, when calling instance_eval or instance_exec on a scope, the scope will fetch its records from...

github.com

As the title says: this jQuery plugin creates bar charts from HTML tables. It comes in some different flavors.

ebobby.org

A technique to vastly reduce the number of join model records that need to be stored in the database.