mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-09 14:58:05 -05:00
Ensure serializable_hash doesn't raise with a frozen :except array
I ran into an issue where options[:except] is a frozen array, which explodes when we try to concat values in `serializable_hash`. To fix this we dup the `:except` option before concatenating with the other options there. Closes #5278.
This commit is contained in:
committed by
Carlos Antonio da Silva
parent
f26e05c200
commit
507573994a
@@ -43,7 +43,7 @@ class SerializableTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
test 'should accept frozen options' do
|
||||
assert_key "username", @user.as_json({only: :username}.freeze)["user"]
|
||||
assert_key "username", @user.as_json({ only: :username, except: [:email].freeze }.freeze)["user"]
|
||||
end
|
||||
|
||||
def assert_key(key, subject)
|
||||
|
||||
Reference in New Issue
Block a user