Sha256: d298c5a2cabb62475adbedf4debb5e7525b34981c6b312d90338c0b520e64e66

Contents?: true

Size: 494 Bytes

Versions: 9

Compression:

Stored size: 494 Bytes

Contents

# frozen_string_literal: true

module Osso
  module Models
    class User < ActiveRecord::Base
      belongs_to :enterprise_account
      belongs_to :saml_provider
      has_many :authorization_codes, dependent: :delete_all
      has_many :access_tokens, dependent: :delete_all

      def oauth_client
        saml_provider.oauth_client
      end

      def as_json(*)
        {
          email: email,
          id: id,
          idp: saml_provider.name,
        }
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
osso-0.0.3.5 lib/osso/models/user.rb
osso-0.0.3.4 lib/osso/models/user.rb
osso-0.0.3.3 lib/osso/models/user.rb
osso-0.0.3.2 lib/osso/models/user.rb
osso-0.0.3.1 lib/osso/models/user.rb
osso-0.0.3 lib/osso/models/user.rb
osso-0.0.2.10 lib/osso/models/user.rb
osso-0.0.2.9 lib/osso/models/user.rb
osso-0.0.2.8 lib/osso/models/user.rb