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

requiremind.com

Batman is an alternative Javascript MVC with a similar flavor as AngularJS, but a lot less features and geared towards...

Development environment setup Rails Composer Basically a comprehensive Rails Template. Prepares your development environment and lets you select web server...

makandra dev

rake stats # => LOC per controllers, models, helpers; code ratios, and more rake notes # => collects TODO, FIXME and...

makandra dev

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

faviconit.com

Eduardo Russo was tired of complex favicon creation and created his own favicon generator. It's really easy and allows...

String#indent is not a standard Ruby method. When you use it, be sure to know where this method comes...

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

Usually, Cucumber feature files live in features/. When you group them in sub directories, make sure to add -r features...

robots.thoughtbot.com

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

class Book::Page end class MyBook < Book def new_page Page.new # has to be `Book::Page` in development to...

makandra dev
tech.taskrabbit.com

At TaskRabbit, we have gone through a few iterations on how we make our app(s). In the beginning, there...

makandra dev
robots.thoughtbot.com

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

dev.mysql.com

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

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

If you have a FooController and also have a layout app/views/layouts/foo.html, Rails will use this without being told so.

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...

On recent/fresh installations of Ruby 1.8.7 you may encounter this error why calling any bundled binary (or just bundle exec...

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.

Modern IRB has time measurement built in. measure # Enable measure :off # Disable Custom Should your version of IRB not offer...

stackoverflow.com

Before Rails 3.2.14, when supplying an invalid locale to I18n, it would fall back to its config.i18n.default_locale (which is...

What Rails version Within before_* Within after_* Cancel later callbacks Rails 1-4 return false return false Cancel later callbacks...