Sha256: 6349a66af08cfce6b9319fcbbf2dc83c4409ef7d616cbb6e3392834d1d8d15d7

Contents?: true

Size: 639 Bytes

Versions: 10

Compression:

Stored size: 639 Bytes

Contents

# include MuckAuth::Models::MuckAuthentication
module MuckAuth
  module Models
    module MuckAuthentication
      extend ActiveSupport::Concern
    
      included do
        belongs_to :authenticatable, :polymorphic => true        
      end
      
      module ClassMethods
        
        def all_services
          services = []
          Secrets.auth_credentials.each_key{ |s| services << s }
          services
        end
        
        def unused_services(current_authentications)
          all_services.find_all{ |s| !current_authentications.any?{ |c| c.provider == s } }
        end
        
      end
    
    end 
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
muck-auth-3.5.0 lib/muck-auth/models/authentication.rb
muck-auth-3.4.0 lib/muck-auth/models/authentication.rb
muck-auth-3.3.3 lib/muck-auth/models/authentication.rb
muck-auth-3.3.2 lib/muck-auth/models/authentication.rb
muck-auth-3.3.1 lib/muck-auth/models/authentication.rb
muck-auth-3.3.0 lib/muck-auth/models/authentication.rb
muck-auth-3.2.3 lib/muck-auth/models/authentication.rb
muck-auth-3.2.2 lib/muck-auth/models/authentication.rb
muck-auth-3.2.1 lib/muck-auth/models/authentication.rb
muck-auth-3.2.0 lib/muck-auth/models/authentication.rb