class Application
def self.authorized_for(resource_owner)
def self.authorized_for(resource_owner) joins(:authorized_applications).where(:oauth_access_tokens => { :resource_owner_id => resource_owner.id }) end
def generate_secret
def generate_secret self.secret = random_string end
def generate_uid
def generate_uid self.uid = unique_random_string_for(:uid) end