Merge requests are often rejected for similar reasons. To avoid this, before you send a merge request, please confirm that...
You have multiple options: Just don't have a type column. All STI magic will be disabled automatically.
Issue this command: sqlite3 ~/Library/Application\ Support/Dock/*.db "DELETE from apps WHERE title='APP_NAME';" && killall Dock This tells sqlite3 to...
Authentication is hard: there are many edge cases, and most users (including yourself) usually only go the "happy path" once...
You can detect city and country from an IP address by using the GeoLite database. This is a flat file...
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...
All columns of a model's database table are automagically available through accessors on the Active Record object.
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
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+.