2010-10-14 14:04:02 -04:00
|
|
|
require 'devise/omniauth'
|
|
|
|
|
|
|
|
module Devise
|
|
|
|
module Models
|
2010-10-14 17:46:10 -04:00
|
|
|
# Adds OmniAuth support to your model.
|
2010-10-14 14:04:02 -04:00
|
|
|
#
|
|
|
|
# == Options
|
|
|
|
#
|
|
|
|
# Oauthable adds the following options to devise_for:
|
|
|
|
#
|
2010-10-14 17:46:10 -04:00
|
|
|
# * +omniauth_providers+: Which providers are avaialble to this model. It expects an array:
|
2010-10-14 14:04:02 -04:00
|
|
|
#
|
2010-10-14 17:46:10 -04:00
|
|
|
# devise_for :database_authenticatable, :omniauthable, :omniauth_providers => [:twitter]
|
2010-10-14 14:04:02 -04:00
|
|
|
#
|
|
|
|
module Omniauthable
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
module ClassMethods
|
|
|
|
Devise::Models.config(self, :omniauth_providers)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|