Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### Unreleased


* enhancements
* Removed deprecations warning output for `Devise::Models::Authenticatable::BLACKLIST_FOR_SERIALIZATION` (@soartec-lab)

### 4.9.2 - 2023-04-03

Expand Down
3 changes: 0 additions & 3 deletions lib/devise/models/authenticatable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ module Authenticatable
:last_sign_in_ip, :password_salt, :confirmation_token, :confirmed_at, :confirmation_sent_at,
:remember_token, :unconfirmed_email, :failed_attempts, :unlock_token, :locked_at]

include Devise::DeprecatedConstantAccessor
deprecate_constant "BLACKLIST_FOR_SERIALIZATION", "Devise::Models::Authenticatable::UNSAFE_ATTRIBUTES_FOR_SERIALIZATION", deprecator: Devise.deprecator

included do
class_attribute :devise_modules, instance_writer: false
self.devise_modules ||= []
Expand Down
6 changes: 0 additions & 6 deletions test/models/serializable_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ class SerializableTest < ActiveSupport::TestCase
assert_key "username", @user.as_json({ only: :username, except: [:email].freeze }.freeze)["user"]
end

test 'constant `BLACKLIST_FOR_SERIALIZATION` is deprecated' do
assert_deprecated("Devise::Models::Authenticatable::UNSAFE_ATTRIBUTES_FOR_SERIALIZATION", Devise.deprecator) do
Devise::Models::Authenticatable::BLACKLIST_FOR_SERIALIZATION
end
end

def assert_key(key, subject)
assert subject.key?(key), "Expected #{subject.inspect} to have key #{key.inspect}"
end
Expand Down