Sha256: 8b209863133cc90a05b83a9e13271a954efb8c679ecb6acf2b83387643d3271b

Contents?: true

Size: 572 Bytes

Versions: 7

Compression:

Stored size: 572 Bytes

Contents

# == Schema Information
#
# Endpoint: /v1/identities
#
#  id         :integer         not null, primary key
#  user_id    :integer
#  provider   :string(255)
#  uid        :string(255)
#  created_at :datetime        not null
#  updated_at :datetime        not null
#

module MnoEnterprise
  class Identity < BaseResource

    attributes :id, :user_id, :provider, :uid, :created_at, :updated_at

    belongs_to :user, class_name: 'MnoEnterprise::User'

    def self.find_for_oauth(auth)
      where(uid: auth.uid, provider: auth.provider).first_or_create
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mno-enterprise-core-3.4.0 app/models/mno_enterprise/identity.rb
mno-enterprise-core-3.3.3 app/models/mno_enterprise/identity.rb
mno-enterprise-core-3.3.2 app/models/mno_enterprise/identity.rb
mno-enterprise-core-3.2.1 app/models/mno_enterprise/identity.rb
mno-enterprise-core-3.3.1 app/models/mno_enterprise/identity.rb
mno-enterprise-core-3.3.0 app/models/mno_enterprise/identity.rb
mno-enterprise-core-3.2.0 app/models/mno_enterprise/identity.rb