Our preferred way of testing ActiveRecord is to simply create/update/destroy the record and then check if the expected behavior has...

Validations should be covered by a model's spec. This card shows how to test an individual validation. This is...

If you expect method calls in RSpec 3, be aware that the argument matchers use very liberal equality rules (more...

A HTTP 302 Found redirect to PATCH and DELETE requests will be followed with PATCH or DELETE. Redirect responses to...

The nokogiri gem provides different packages for several platforms. Each platform-specific variant ships pre-built binaries of libxml2, e.g...

Ruby has the class Proc which encapsulates a "block of code". There are 2 "flavors" of Procs: Those with "block...

Our applications not only need to be functional, they need to be fast. But, to quote Donald Knuth, premature optimization...

This is a guide on how to effectively use Git when working on a feature branch. It is designed to...

makandra dev

Starting with Ruby 1.9, most #each methods can be called without a block, and will return an enumerator. This is...

To safely transport an arbitrary string within a URL, you need to percent-encode characters that have a particular meaning...

If the project team consists of at least 2 members, do a daily standup. It should not take much longer...

We organize our daily work with issues in our Linear workspace. Issue format A good issue needs to be precise...

When starting a project we always make a good estimate of all known requirements, and plan budgets and available developers...

Ruby has Enumerable.find(&block), which returns the first item in the collection for which the block evaluates to true.

On Ruby 1.9+, standard ruby character classes like \w, \d will only match 7-Bit ASCII characters: "foo" =~ /\w+/ # matches...

makandra dev

tig is a command line explorer for Git that is just awesome. Install via apt-get or brew. Handy commands...

Several Rails migration methods accept index: true as an option to create an index. In some cases (like #add_column...

# Given the following models class Image < ActiveRecord::Base has_many :album_images has_many :albums, through: :album_images

When ending a Selenium test Capybara resets the browser state by closing the tab, clearing cookies, localStorage, etc.

You know that ActiveRecord caches associations so they are not loaded twice for the same object. You also know that...

Web applications can be used by multiple users at the same time. A typical application server like Passenger has multiple...

This guide shows how to create an AngularJS application that consumes more and more memory until, eventually, the browser process...

The CSS property z-index is not as global as you might think. Actually, it is scoped to a so...

Here is a Javascript function reloadUsers() that fetches a HTML snippet from the server using AJAX and replaces the current...