Clearance vs. Devise

Published on by   rails

Thoughtbots clearance gem is an alternative to the more popular Devise gem that allows you to easily add authentication to a Rails app.

I’ve been a long time user of Devise and from what I have seen in the ruby community it’s popularly is vast. Starting most new rails apps it’s been one of the first gems added to my projects.

I recently looked at clearance and admired the simplicity of it, coming from devise I knew it was a lot more feature rich but the reality is I struggle to think of a project that has required me to use more functionality than clearance provides so I decided to try clearance on my next rails app.

How it worked out

Less configuration

Clearance took even less time to setup than devise, I find this is because it aligns more closely with the Rails mantra ‘convention over configuration’.

Less complexity

I was able to read through clearances source code quickly and understood everything. Having tried to read through the devise source code before and struggling a bit to piece together all of the abstractions this was a welcome surprise.

Active job integration

Clearance automatically integrates with active job to send emails in the background, something that you have to add an extra gem for in devise.

Wrapping up

I’m sure there are plenty of projects out there that need the additional features of devise but there are even more that don’t and sticking with a simpler less complex tool can’t be a bad choice. I’m going to stick with clearance on most projects going forward.

Related Articles

In a recent project I have been using UUIDs as the primary key type with Rails 5 and PostgreSQL. This can be useful if your objects IDs are…

Searching proximity to a location is a task we have done before in a traditional database with some complex trigonometry algorithms. As we…

Keeping track of your apps scheduled tasks is usually a bit of a pain. It can be handled outside of your normal code processes such as…

Would you like to work with us?

We would love to hear from you

Get in touch

© Alternate Labs Ltd is a registered company in Northern Ireland NI628282