applicake/doorkeeper — pull request #175 by miyagawa (2012-12-06 23:37:55+00:00)
Title: Make token.expires_in_seconds return nil when expires_in is nil

Current implementation of `expires_in_seconds` throws errors when `expires_in` is nil (i.e. token doesn't expire) with: `NoMethodError: undefined method `seconds' for nil:NilClass`

This makes the TokenInfoController not worky with such tokens because it's called in the JSON rendering.

This patch just returns nil in `expires_in_seconds` in such case.