]> git.openstreetmap.org Git - rails.git/blob - app/models/user_token.rb
Return GPX traces as application/gpx+xml instead of text/xml
[rails.git] / app / models / user_token.rb
1 class UserToken < ActiveRecord::Base
2   belongs_to :user
3
4   attr_accessible :referer
5
6   after_initialize :set_defaults
7
8   def expired?
9     expiry < Time.now
10   end
11
12 private
13
14   def set_defaults
15     self.token = OSM::make_token() if self.token.blank?
16     self.expiry = 1.week.from_now if self.expiry.blank?
17   end
18 end