Inconsistent behaviour in UserUpdater class

My analysis comes down to this.

# case 1
u1 = User.find(1)
u1.custom_fields[:user_field_1] = "abc"
u1.save

# case 2
u1.custom_fields["user_field_1"] = "abc"
u1.save

In case 1, A new UserCustomField is created per call to u1.save

In case 2, All UserCustomField with the name ‘user_field_1’ are deleted from the db
except the specified.

Screenshot 2020-08-20 at 11.56.49 AM

All and all the symbol and string versions of the same key are treated differently in the HasCustomFields mixin.