When attempting to upgrade an app using active_model_otp to Rails 8 we started seeing error: can't modify frozen Hash errors when passing options into to_json on a model with has_one_time_password.
The error triggers at:
https://github.com/heapsource/active_model_otp/blob/main/lib/active_model/one_time_password.rb#L118
It seems that Rails 8 freezes incoming options for #serializable_attributes, making this mutation illegal.
When attempting to upgrade an app using
active_model_otpto Rails 8 we started seeingerror: can't modify frozen Hasherrors when passing options intoto_jsonon a model withhas_one_time_password.The error triggers at:
https://github.com/heapsource/active_model_otp/blob/main/lib/active_model/one_time_password.rb#L118
It seems that Rails 8 freezes incoming options for
#serializable_attributes, making this mutation illegal.