Rails 4.2 Launched with Some Cool Feature

A couple of days ago, Rails 4.2 is officially launched. There are a couple of feature that I know I will be glad for. One thing is adequate records that make simple query like ‘find’ is faster. Aaron Patterson’s blog cover the details of adequate records.

Other thing that will be useful is the active job. Active job is an adapter for various queuing system like Resque, Sidekiq, Sucker Punch, Delayed Job, etc. This will come handy, for example when it’s time to graduate from Sucker Punch into something more sophisticated like sidekiq, I don’t have to rewrite the job.

Web console is also interesting, though some of my friends said that this make the current Rails bloated. I find this feature is fun. See the gem page for some demos.

You can see the complete features list in the release notes.

Just to celebrate, I upgraded brentimana.com to Rails 4.2. By following the upgrading guide, I manage the upgrades without many glitches. In brentimana’s case, I just had to watch out about the responders, that now has been extracted into the responders gem. Voila, brentimana is now running on Rails 4.2

Brentimana on Rails 4.2
Brentimana on Rails 4.2

Actually, the new Rails has many small but useful “hidden” features. Justin Weiss cover them nicely here.

Skip bundle exec when using rbenv

If you are using rbenv and bundler like I did, you must be feeling tired writing ‘bundle exec blabla’ everytime you use executables in your rails project. Fortunately, you don’t have to. You can use this rbenv plugin to automatically bundle exec your command. By default this plugin ignore ‘gem’ command, since normally you shouldn’t run gem with bundle exec.

While we are at it, another useful rbenv plugin is rbenv-gem-rehash. That plugin automatically run ‘rbenv rehash’ everytime you install a new gem. So, you don’t need to rehash everytime you run ‘bundle install’

This is a short post, but hopefully it’s usefull enough. See you!