title: Ruby on Rails - Custom token expiration
body: <p>I'm currently migrating a Rails application running with Mongodb to move to Psql. There are some roadblocks and this is one of them that I'm investigating solutions for. Is there a way to set expiration index on a model attribute or an alternative solution to achieve similar functionality? This is how we have implemented in Mongo,</p>
  
  <pre><code>field :impersonate_token
  index({ impersonate_token: 1 }, expire_after_seconds: 60)
  </code></pre>
  
  <p>This is a custom token with :impersonatable by devise. 
  Please share if you know of a way to achieve this with Postgres. </p>
  
  <p>Thank you. </p>