Rails understands a :limit options when you create columns in a migration. Its meaning depends on the column type, and...
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...
When MySQL refuses to use your index, there's a number of things that you may be doing wrong. One...
MongoMapper is a MongoDB adapter for Ruby. We've forked it so it works for Rails 2.3.x applications running...
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...
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...
As the title says: this jQuery plugin creates bar charts from HTML tables. It comes in some different flavors.
A technique to vastly reduce the number of join model records that need to be stored in the database.
If you get a stacktrace complaining about uninitialized constant MysqlCompat::MysqlRes a system library update might broke your gem.
The classical scenario: There's a parent div element and you want to center some arbitrary child element vertically inside...
In theory you can take any scope and extend it with additional joins or conditions. We call this chaining scopes...
If your application has forms to edit string fields, you probably want to strip the entered values (remove whitespace from...
Example task: Multiply the table holidays between several stages. Open two terminals: shell-for stage_1 shell-for stage_2...
Cucumber_rails' old-school web-steps have been deprecated for a while, urging developers to write high-level step definitions...
Simply use OpenStruct#to_h to receive an OpenStruct's hash representation. In older Rubies you need OpenStruct#marshal_dump...