ActiveRecord has a feature called counter caching where the containing record in a has_many relationship caches the...

Selenium cannot reliably control a browser when its window is not in focus, or when you accidentally interact with the...

If you can now longer hear or record sounds after upgrading Ubuntu, you probably need to re-tell Ubuntu which...

In Rails 2, when calling instance_eval or instance_exec on a scope, the scope will fetch its records from...

ebobby.org

A technique to vastly reduce the number of join model records that need to be stored in the database.

If you get a stacktrace complaining about uninitialized constant MysqlCompat::MysqlRes a system library update might broke your gem.

Since I use this a lot in my daily work and there were no scripts working properly for me, I...

When you have two models in a has_many, has_one or belongs_to association, the :inverse_of option in...

Icon fonts like Font Awesome are infinitely scalable, look great on high-DPI displays and will give your app a...

Generally, Selenium tests use the browser to interact with the page. If it's unavailable, a timeout error is...

In theory you can take any scope and extend it with additional joins or conditions. We call this chaining scopes...

If you require your Rails models manually, pay attention to the path you use. Unless you have...

If your application has forms to edit string fields, you probably want to strip the entered values (remove whitespace from...

Example task: Multiply the table holidays between several stages. Open two terminals: shell-for stage_1 shell-for stage_2...

If this happens to you: user.avatar = Avatar.new user.avatar # => nil (where avatar is a belongs_to), you probably declared your association...

There is no reason to leave trailing whitespace characters in your project's files, so don't add any.

web.archive.org

TL;DR Avoid before(:context) (formerly before(:all)), use before(:example) (formerly before(:each)) instead. If you do use before...

makandra dev

Today I got a better understanding of how git works, in particular what git checkout and git reset do.

StaticMatic is a nice tool to build simple static websites. In case you want to have some nifty styles on...

When you work in the MySQL console and you want to see which database is used, type: SELECT database();

If you want to update some records with boolean fields in a migration, always remember to set your values with...

makandra dev

This article describes how to reset MySQL's or MariaDB's root password on your workstation. It's meant for...

Note: Instead of using the method in this card, you probably want to use ActiveType's nested attributes which is...

logicalfriday.com

How delayed jobs can make your after_save callbacks execute before the record is saved.