Sha256: bf5b01f46c866923de89dcecff7a8956bbd9b077064e916af8a9d54d6c1591a5

Contents?: true

Size: 780 Bytes

Versions: 139

Compression:

Stored size: 780 Bytes

Contents

# frozen_string_literal: true

require "active_support/concern"

# Concern for Devise enhancements
# eg. User approval and password expiry
#
module Renalware
  module Deviseable
    extend ActiveSupport::Concern

    included do
      class_eval do
        devise(:expirable, :database_authenticatable, :registerable,
               :rememberable, :trackable, :validatable, :timeoutable, :recoverable)
      end

      # Makes the User 'approvable'
      # See https://github.com/plataformatec/devise/wiki/How-To:-Require-admin-to-activate-account-before-sign_in
      def active_for_authentication?
        super && approved?
      end

      def inactive_message
        if !approved?
          :not_approved
        else
          super
        end
      end
    end
  end
end

Version data entries

139 entries across 139 versions & 1 rubygems

Version Path
renalware-core-2.0.159 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.158 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.157 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.156 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.155 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.153 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.152 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.151 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.149 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.148 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.147 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.146 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.145 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.144 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.143 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.142 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.141 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.140 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.139 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.138 app/models/concerns/renalware/deviseable.rb