Sha256: 6bb5c8a0653a8d4a74e3b6a7ed7c791f6f3e5d3024e34a0c2d7ea11935744037

Contents?: true

Size: 735 Bytes

Versions: 4

Compression:

Stored size: 735 Bytes

Contents

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)
      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

4 entries across 4 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta7 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.0.pre.beta6 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.0.pre.beta5 app/models/concerns/renalware/deviseable.rb
renalware-core-2.0.0.pre.beta4 app/models/concerns/renalware/deviseable.rb