Sha256: 57fe1f362269912633f3f1744b5f074dc84343a7fd97e7c674dcbb9bcc5012fe

Contents?: true

Size: 449 Bytes

Versions: 10

Compression:

Stored size: 449 Bytes

Contents

# frozen_string_literal: true

module Stenographer
  class Authentication < ApplicationRecord
    validates :provider, presence: true
    validates :uid, presence: true

    has_many :outputs, class_name: 'Stenographer::Output', dependent: :destroy

    def self.providers
      distinct(:provider).pluck(:provider)
    end

    def credentials_hash
      credentials.present? ? JSON.parse(credentials, symbolize_names: true) : {}
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
stenographer-rails-0.7.4 app/models/stenographer/authentication.rb
stenographer-rails-0.7.3 app/models/stenographer/authentication.rb
stenographer-rails-0.7.1 app/models/stenographer/authentication.rb
stenographer-rails-0.7.0 app/models/stenographer/authentication.rb
stenographer-rails-0.6.5 app/models/stenographer/authentication.rb
stenographer-rails-0.6.4 app/models/stenographer/authentication.rb
stenographer-rails-0.6.3 app/models/stenographer/authentication.rb
stenographer-rails-0.6.2 app/models/stenographer/authentication.rb
stenographer-rails-0.6.1 app/models/stenographer/authentication.rb
stenographer-rails-0.6.0 app/models/stenographer/authentication.rb