]> git.openstreetmap.org Git - rails.git/blob - app/models/access_token.rb
Added a few more tests
[rails.git] / app / models / access_token.rb
1 class AccessToken < OauthToken
2   belongs_to :user
3   belongs_to :client_application
4
5   scope :valid, -> { where(:invalidated_at => nil) }
6
7   validates :user, :secret, :presence => true
8
9   before_create :set_authorized_at
10
11   protected
12
13   def set_authorized_at
14     self.authorized_at = Time.now
15   end
16 end