Sha256: 74e091abc2a30ca9261cbb10032fe320f78d1fae075544616d533a5620e3c5ea

Contents?: true

Size: 545 Bytes

Versions: 1

Compression:

Stored size: 545 Bytes

Contents

module Passport
  module Oauth
    module Queryable
      def self.included(base)
        base.extend ClassMethods
        base.send :include, InstanceMethods
      end
      
      module ClassMethods
        # if we're lucky we can find it by the token.
        def find_by_key_or_token(key, token)
          result = self.find_by_key(key) unless key.nil?
          result = self.find_by_token(token) if !(result && token.blank?)
          result 
        end
      end
      
      module InstanceMethods
        
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
passport-0.1.1 lib/passport/oauth/client/queryable.rb