When you want to UPDATE a table with information from an associated table, you can JOIN the associated table into...
Starting from Rails 4.0, you can use a special form options helper called #collection_check_boxes. It behaves similar to...
Web applications can be used by multiple users at the same time. A typical application server like Passenger has multiple...
You can hook into Slack when using Capistrano for deployment. The slackistrano gem does most of the heavy lifting for...
SELECT table_name, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'your_database' order by table_rows;
The linked article explains how to get a database-wide lock without creating table rows: This article explains how I...
If you want to load an SQL dump from an ActiveRecord migration, you might find this to be harder than...
In the tradition of our PostgreSQL cheat sheet for MySQL lamers, here is a cheat sheet for Jasmine when you...
Rails guide that covers PostgreSQL-specific column types and usages for Active Record. You should especially keep in mind the...
The Angular ngSrc directive serves to properly set an image src via Angular. As anything in Angular, it updates the...
We upgraded a Rails 2 application to Rails 3.2 and Ruby 2.1, changed the mysql adapter from mysql to mysql2...
Directly from the MySql docs: There are three likely causes for this error message. Usually it indicates network connectivity trouble...
Open a MySQL root shell and use this command: PURGE BINARY LOGS BEFORE DATE(NOW() - INTERVAL 3 DAY) + INTERVAL 0...
By default, Rails' validates_uniqueness_of does not consider "username" and "USERNAME" to be a collision. If you use MySQL...
You might have a table without a primary key set in MySQL. You can fix this by adding a primary...
For reasons that completely escape me, MySQL 5.x limits UTF-8 strings to U+FFFF and smaller.
Like in any language, a FLOAT will eventually corrupt data due to rounding errors. Please use DECIMAL, which has well...
Crazy hack. Might be useful one day. The code required has since been extracted into a library.
I had a huge MySQL dump that took forever (as in: days) to import, while I actually just wanted to...
A MySQL DECIMAL column is used when it is important to preserve exact precision. It takes two parameters, where...
TLDR: This card explains which threads and processes interact with each other when you run a Selenium test with Capybara...
If you want to sort a Ruby array with a primary, secondary, etc. criterium, use a sort_by that contains...
Usually our mysql queries are not case sensitive. In order to query case sensitive, you can use the mysql COLLATE...
Ubuntu has a package mysql-sandbox that lets you install multiple MySQL versions into your user home: Install mysql-sandbox...