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.
TL;DR Avoid before(:context) (formerly before(:all)), use before(:example) (formerly before(:each)) instead. If you do use before...
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...
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...
How delayed jobs can make your after_save callbacks execute before the record is saved.
For string columns, MySQL indexes the left side of a string. That means an index can speed a like query...
Be careful when stubbing out attributes on records that are defined by associations. Nothing is as it seems to be...
No one wants to cry over regression issues in views; does testing HTML and CSS have to be such a...
So you got this error, even though your Gemfile bundles mysql2: !!! Missing the mysql2 gem. Add it to your Gemfile...
The next version of MySQL will include a built-in memcached daemon. This daemon can quickly get and set key/value...
assignable_values now lets you define a secondary default that is only used if the primary default value is not...
paper_trail is an excellent gem to track record versions and changes. You almost never want to reimplement something like...