Sha256: dcf838597bca8b952620071209f7e50b4c5d2174011dbd0756dc297a0979126a
Contents?: true
Size: 613 Bytes
Versions: 5
Compression:
Stored size: 613 Bytes
Contents
# frozen_string_literal: true class Spree::AuthenticationMethod < ApplicationRecord def self.provider_options SolidusSocial.configured_providers.map { |provider_name| [provider_name.split("_").first.camelize, provider_name] } end validates :provider, presence: true def self.active_authentication_methods? where(environment: ::Rails.env, active: true).exists? end scope :available_for, lambda { |user| sc = where(environment: ::Rails.env) sc = sc.where(['provider NOT IN (?)', user.user_authentications.map(&:provider)]) if user && !user.user_authentications.empty? sc } end
Version data entries
5 entries across 5 versions & 1 rubygems