medium.com

When you, as a developer, look at the choices used to build a particular application, you’re blown away at...

By default, Rails' validates_uniqueness_of does not consider "username" and "USERNAME" to be a collision. If you use MySQL...

Put the attached file to config/initalizers to ignore some fields for rejecting nested records (e.g. hidden input fields).

When you use a belongs_to or has_many macro you might be surprised that the methods that it generates...

Store each models version in a separate table class Post < ActiveRecord::Base has_paper_trail :class_name => 'PostVersion' end

makandra dev

Just found out about a great feature in Rails that seems to be around since Rails 2. Start a console...

You might have a table without a primary key set in MySQL. You can fix this by adding a primary...

Wondering how a specific method on an object is exactly named? You can use Enumerable#grep to detect it in...

codeka.com.au

For reasons that completely escape me, MySQL 5.x limits UTF-8 strings to U+FFFF and smaller.

Like in any language, a FLOAT has complicated semantics for precision. This sometimes causes stored numbers to be slightly off...

robots.thoughtbot.com

Arel is a library that was introduced in Rails 3 for use in constructing SQL queries. Every time you pass...

robots.thoughtbot.com

Rails 4.0 introduced a helpful new method for ActiveRecord queries: where.not. It can make clunky queries easier to read.

I had a huge MySQL dump that took forever (as in: days) to import, while I actually just wanted to...

dev.mysql.com

A MySQL DECIMAL column is used when it is important to preserve exact precision. It takes two parameters, where...

We have released Modularity 2. It has many incompatible changes. See below for a script to migrate your applications automatically...

When you do something like this in your code: def var_value @var ||= some_expensive_calculation end

TLDR: This card explains which threads and processes interact with each other when you run a Selenium test with Capybara...

tl;dr: Using has_many associations with a :through option can lead to lost or duplicate records. You should avoid...

Setting the colorbox opacity by hash parameter when initializing doesn't work the way like the documentation tells you.

We've since created ActiveType which has a restricted subset of Virtus' features. It might be enough for your needs...

In Ruby, classes and modules are called constants. This card explains how Ruby resolves the meaning of a constant.

Goal Within before_* Within after_* Cancel later callbacks throw :abort throw :abort Rollback the transaction throw :abort raise ActiveRecord::Rollback...

If you're still working on ruby 1.8, you should know that using SimpleDelegator is often prohibitively slow. I have...

This error occurs when you already have a database.yml which defines the database for the cucumber environment instead of test...