Class: Authentication

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
app/models/authentication.rb

Overview

Store omni-auth Authentications in an extra collection. This is rational-related to the User-model to prevent us to iterate through all user when we receive a callback-request from the provider.

Instance Method Summary (collapse)

Instance Method Details

- (Object) provider_name

Some providers can not be displayed as a humanized version of their symbol. provide_name will do the translation.



18
19
20
21
22
23
24
25
26
27
# File 'app/models/authentication.rb', line 18

def provider_name
  case provider
  when 'open_id'
    "OpenID"
  when 'thirty_seven_signals'
    '37 Signals'
  else
    provider.titleize
  end
end