Sha256: 7cc70bf30aaf74b4543be34c74375ba87e0146c15d00ba37a25f93634b63bc41
Contents?: true
Size: 629 Bytes
Versions: 53
Compression:
Stored size: 629 Bytes
Contents
# frozen_string_literal: true module Ibrain module UserMethods extend ActiveSupport::Concern include Ibrain::UserApiAuthentication included do after_create :auto_generate_ibrain_api_key include Ibrain::RansackableAttributes unless included_modules.include?(Ibrain::RansackableAttributes) end def auto_generate_ibrain_api_key return if !respond_to?(:ibrain_api_key) || ibrain_api_key.present? if Ibrain::Config.generate_api_key_for_all_roles || (ibrain_roles.map(&:name) & Ibrain::Config.roles_for_auto_api_key).any? generate_ibrain_api_key! end end end end
Version data entries
53 entries across 53 versions & 1 rubygems