Avoid png file uploads with RSpec + Paperclip + Imagemagick
File uploads with .png are +10 times slower than using .jpeg or .gif. # Bad post :create, { :property_id => property.id,
If you GROUP BY, make sure you ORDER BY NULL
TL;DR: If using :group => :some_field you might want to :order => 'NULL'. According to the man By default, MySQL...
has_defaults issues
The object returned by has_defaults apparently is the same between multiple object creations. Consider this scenario:
Killing wkhtmltopdf during cucumber
wkhtmltopdf hangs on mac during cucumber unless we click on it. The main reason is with the version we use...
To avoid using bundle exec or creating rvm gemsets
Add to the end your .bash_profile export PATH="./vendor/bundle/bin:$PATH" Also add alias bi="bundle install --path vendor/bundle --binstubs...
Database: Scopes, migrations, and indices
Wether you modify an existing named scope or add a new one, or when you write a new query, make...
Cleaner Rspec
When simply checking equality or truthiness then Instead of: it "should have role set to admin" do @user.role.should eql('admin...
Method return value should always be of same type
One of the main source of bugs and complexity in the code is when a functional method (that we expect...
Keeping your specs DRY
I often see long before blocks with lots of should_receive...
...and_return inside. Remember that before blocks are about...