Lets say we have a user with a contract whereas contract is a mounted carrierwave file. Now we want to...
This might be a known issue with Rubygems 2.5.1. This will help: gem update --system
When you need test images, instead of using services like lorempixel or placehold.it you may generate test images yourself.
If the argument list is the same every time: expect(object).to receive(:foo).with('argument').and_return('response 1...
When you find yourself constantly ignoring a RubyMine warning, you can simple disable that warning and de-clutter your editor...
You might have some trouble running a Rails LTS 2 app with MySQL 5.7. If you don't want to...
MySQL and MariaDB have an SQL mode setting which changes how MySQL behaves. The SQL mode value is comprised of...
Rails offers a way to prepend (or append) view paths for the current request. This way, you can make the...
The httpclient gem comes with a custom SSL cert store. While an customizable, application-level cert store is great when...
When you have string contents (e.g. a generated binary stream, or data from a remote source) that you want to...
You need to update a lof gems. Make sure you don't have any version constraints in your...
In Spreewald 1.10.4+, nested patiently blocks are now patient. Here is an example: patiently do outer_code patiently do
Your default postgres user is named like your linux user. That default user has limited access privileges, which can cause...
Use bundler > 1.15 to fix Gem::LOADED_SPECS_MUTEX (NameError). Given the following project: ruby -v ruby 1.8.7
When your Rails controller calls render, you can pass a :status option for the HTTP status code: render 'results', status...
When a Rails controller action should handle both HTML and JSON responses, do not use request.xhr? to decide that. Use...
Note netstat has mostly been superseeded by its more modern rewrite ss which nowadays comes pre-installed rather than netstat...
When installing gems, a lot of time is spent building locally installed documentation that you probably never use.
When you have a pending Cucumber step (or feature) that also uses an existing VCR cassette, your pending test may...
Katapult 0.3.0 brings Rails 5 and Ruby 2.5 support with a new design, plus a ton of smaller features, fixes...
Enumerable#all? returns true for an empty collection. This totally makes sense but you have to think about it when...
ActiveSupport::Dependencies takes care of auto-loading any classes in development. This is usually useful, but when you run into...
TL;DR Use user.update!(remove_avatar: true) to delete attachments outside of forms. This will have the same behavior as...
To check which elements an ActiveRecord relation contains use the contain_exactly matcher. describe User do let!(:admin) { create(:user...