# File lib/oauth/models/consumers/token.rb, line 50 def find_or_create_from_access_token(user, access_token, new_token = nil) if access_token.class.ancestors.include?(Oauth2Token) token = access_token else if user token = self.find_or_initialize_by_user_id_and_token(user.id, access_token.token) else token = self.find_or_initialize_by_token(access_token.token) end end token = if new_token then set_details(new_token, access_token) else set_details(access_token, token) end token.save! if token.new_record? or token.changed? token end