Skip to content

Commit

Permalink
Don't require ActiveRecord
Browse files Browse the repository at this point in the history
  • Loading branch information
BjarneD committed Apr 23, 2024
1 parent 22ed469 commit 38c3ce2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/devise/pwned_password/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module PwnedPassword

included do
validate :not_pwned_password,
if: (defined?(ActiveRecord) && ActiveRecord.gem_version >= Gem::Version.new("5.1.x")) ? :will_save_change_to_encrypted_password? : :encrypted_password_changed?
if: respond_to?(:will_save_change_to_encrypted_password?) ? :will_save_change_to_encrypted_password? : :encrypted_password_changed?
end

module ClassMethods
Expand Down

0 comments on commit 38c3ce2

Please sign in to comment.