Delete tokens for an application when the application is deleted

This commit is contained in:
Tom Hughes 2012-04-23 21:30:41 +01:00
parent 510eefe752
commit 53fe84fbef

View file

@ -2,7 +2,7 @@ require 'oauth'
class ClientApplication < ActiveRecord::Base
belongs_to :user
has_many :tokens, :class_name => "OauthToken"
has_many :tokens, :class_name => "OauthToken", :dependent => :delete_all
has_many :access_tokens
has_many :oauth2_verifiers
has_many :oauth_tokens