Customizing Devise authentication, to check for active Chargify subscription

This post is an extension of article. I added further customization to check if user has active chargify_subscription and then only proceed to login otherwise show custom message instead of default devise message. Here is what I did (2 step process). In our user model (specifically user_extensions) override devise method active_for_authentication as follows def active_for_authentication? super && locked? && active_subscription? end Calling super first is very important here, to have devise perform all its regular checks first and then upon success we can proceed to add our custom checks. locked? is