Query Trail

Recently I switched on a project with lots of legacy code. It was on Rails 2, Rails 3 and now I've updated it to Rails 4.1. You can't even imagine how much rubbish I got rid of. But the thing I'd like to share with you today is QueryTrail. This simple but useful gem

Rails autoloading

There is much to be said about Rails autoloading and particularly about ActiveSupport::Dependencies (AS::D for short). What does it do? As the title says it loads constants automatically and reloads your code catching changes on every request. Ok, why do we need it? Because it's convenient! We don't have to

Ruby inherited method bug

This post is about the bug I found when I was writing tests for quiet_assets. I won't show you all those tests, just a small piece:

3 do
    routes.append { ... }

All of them were passed on my laptop, but Travis-CI showed me the odd message

See the difference

Yesterday I faced the strange behaviour of the array wrapping in context of Arel. I tried to wrap something like this User.arel_table[:id] but Array(User.arel_table[:id]) and Array.wrap(User.arel_table[:id]) gave me different results. Now I'll tell you why you have to know about