Skip to content

Commit

Permalink
Merge pull request #5598 from soartec-lab/task/removed-older-deprecat…
Browse files Browse the repository at this point in the history
…ion-warning

Removed deprecations warning output for `Devise::Models::Authenticatable::BLACKLIST_FOR_SERIALIZATION`
  • Loading branch information
rafaelfranca authored Jun 9, 2023
2 parents 19d9dab + e524a3d commit 9be24c0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
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

0 comments on commit 9be24c0

Please sign in to comment.