-
Notifications
You must be signed in to change notification settings - Fork 513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FrozenError when calling .new
on STI model with state_machine in Rails 6.1
#363
Comments
I'm also hitting the "can't modify Frozen Hash" on Rails My |
Same here from Rails |
Seeing the same thing here. We make use of A number of Hashes were frozen in this commit. Still not sure of a workaround yet but at least we know where it came from and maybe even why. |
FYI, since this gem hasn't been updated in 10 years, we updated to the What's super nice is that it's a drop-in replacement. We're still conducting testing but it seems to fix our issue on Rails 6.1. |
Just tried this. Swapped in |
Calling
.new
on an ActiveRecord Single Table Inheritance model with a state_machine defined results in a "FrozenError: can't modify frozen Hash" since Rails 6.1.Example, suppose we have the following model:
which has a state and type column (the latter enabling STI) and some subclasses extending from Car. We would expect
Car.new
to return a new Car instance, but instead it crashes with "FrozenError: can't modify frozen Hash:".Rails version: 6.1.4.1
Ruby version: 2.7.3
State machine version: 1.2.0
This did work in Rails 6.0 and before.
The text was updated successfully, but these errors were encountered: