#
class AccessToken < OauthToken
- belongs_to :user
- belongs_to :client_application
+ belongs_to :user, :optional => true
+ belongs_to :client_application, :optional => true
scope :valid, -> { where(:invalidated_at => nil) }
protected
def set_authorized_at
- self.authorized_at = Time.now
+ self.authorized_at = Time.now.utc
end
end