Note: This technique is confusing and slows down your test suite. Copy the attached code to features/support. This gets you...
When you use ab to do some performance benchmarking, you might run into output like this: Complete requests: 200
Rails’ reputation as a relatively secure Web framework is well deserved. Out-of-the-box, there is protection against many...
Sometimes you might want to limit the number of associated records in a has_many association, but cannot add a...
Rails flashes (FlashHash) track a list of used keys, which is not respected when comparing flash hashes.
Do not pass times to date attributes. Always convert times to dates when your application uses time zones. Background
Rails understands a :limit options when you create columns in a migration. Its meaning depends on the column type, and...
Google Chrome saves your profile data in ~/.config/google-chrome. To transfer the profile to for example a system you have setup...
TL;DR: You should generally use #size to count associated records. size Counts already loaded elements If the association is...
Here is a hacky way to load dumps directly from the source server, without fully copying them over and extracting...
When MySQL refuses to use your index, there's a number of things that you may be doing wrong. One...
If you need to capture signatures on an IPad or similar device, you can use Thomas J Bradley's excellent...
This page lists many query methods and options in ActiveRecord which do not sanitize raw SQL arguments and are not...
In our continued quest to extract proven code snippets from makandropedia into tested and upgradable gems, we have released Edge...
The Edge Rider gem gives your relations a method #traverse_association which returns a new relation by "pivoting" around a...
TLDR: Ruby class variables (@@foo) are dangerous in many ways. You should avoid them at all cost. See bottom of...
When creating an ActiveRecord with .new, .create or create!, you cannot set the ID attribute (note: When using Machinist's...
There is a bug in ActiveRecord 2.3.x that leads to changes in nested forms getting lost. class Project < ActiveRecord...
About Chrome's network stack and optimizations to load web pages faster.
Ruby has two different ways to match the start and the end of a text: ^ (Start of line) and $ (End...
Defining one callback several times in the same class behaves different in ActiveRecord and ResourceController. While in ActiveRecord the callbacks...
Consul 0.6.1+ gives your Power class a number of static methods that behave neutrally in case Power.current is nil. This...
Consul 0.6.1+ gives you a way to dynamically access and query powers for a given name, model class or record...
validates_uniqueness_of is not sufficient to ensure the uniqueness of a value. The reason for this is that in...