2013-10-26 backport from railsgirls.com