1module PerishableTokenGenerator
 
2  extend ActiveSupport::Concern
 
3
 
4  class_methods do
  • Complexity 2 » saikuro
5    def has_perishable_token(called: 'perishable_token')
 
6      before_create do
 
7        write_attribute(called, Authlogic::Random.friendly_token)
 
8      end
 
 9    end
 
10  end
 
11end