Sha256: e46b9e4671a12bb7528d3f6a3a6436d0193b8e91da6927c511217de82d1a18ef

Contents?: true

Size: 729 Bytes

Versions: 3

Compression:

Stored size: 729 Bytes

Contents

# coding: utf-8
class Authentication < ActiveRecord::Base
  attr_accessible :user_id, :provider, :uid, :name, :email
  validates_presence_of :provider, :uid
  belongs_to :user

  xss_terminate

  # PROVIDERS = [
  #   ['facebook', 'Facebook'],
  #   ['twitter', 'Twitter'],
  #   ['vkontakte','Vkontakte'],
  #   ['mailru','Mail.ru'],
  #   ['open_id','OpenID'],
  #   ['flickr','Flickr'],
  #   ['odnoklassniki','Odnoklassniki'],
  #   ['you_tube','YouTube']
  # ]

  def self.providers
    [
      ['facebook', 'Facebook'],
      ['vkontakte', 'Vkontakte'],
      ['odnoklassniki', 'Odnoklassniki']
    ]
  end

  def provider_name
    if provider == 'open_id'
      "OpenID"
    else
      provider.titleize
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
devise_russian-0.0.13 app/models/authentication.rb
devise_russian-0.0.12 app/models/authentication.rb
devise_russian-0.0.11 app/models/authentication.rb