Sha256: 621fa214c4521792ef2c016410477f517b670e6347123cb59359626c33e9cfe6

Contents?: true

Size: 997 Bytes

Versions: 12

Compression:

Stored size: 997 Bytes

Contents

# frozen_string_literal: true

module SharedUserWithoutEmail
  extend ActiveSupport::Concern

  included do
    # NOTE: This is missing :validatable and :confirmable, as they both require
    # an email field at the moment. It is also missing :omniauthable because that
    # adds unnecessary complexity to the setup
    devise :database_authenticatable, :lockable, :recoverable,
           :registerable, :rememberable, :timeoutable,
           :trackable
  end

  # This test stub is a bit rubbish because it's tied very closely to the
  # implementation where we care about this one case. However, completely
  # removing the email field breaks "recoverable" tests completely, so we are
  # just taking the approach here that "email" is something that is a not an
  # ActiveRecord field.
  def email_changed?
    raise NoMethodError
  end

  def respond_to?(method_name, include_all=false)
    return false if method_name.to_sym == :email_changed?
    super(method_name, include_all)
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
devise-security-0.16.0 test/dummy/lib/shared_user_without_email.rb
devise-security-0.15.0 test/dummy/lib/shared_user_without_email.rb
devise-security-0.14.3 test/dummy/lib/shared_user_without_email.rb
devise-security-0.14.2 test/dummy/lib/shared_user_without_email.rb
devise-security-0.14.1 test/dummy/lib/shared_user_without_email.rb
devise-security-0.14.0 test/dummy/lib/shared_user_without_email.rb
devise-security-0.14.0.rc1 test/dummy/lib/shared_user_without_email.rb
devise-4.5.0 test/rails_app/lib/shared_user_without_email.rb
devise-4.4.3 test/rails_app/lib/shared_user_without_email.rb
devise-4.4.2 test/rails_app/lib/shared_user_without_email.rb
devise-4.4.1 test/rails_app/lib/shared_user_without_email.rb
devise-4.4.0 test/rails_app/lib/shared_user_without_email.rb