Closed
Description
On initialisation of a new resource, attributes set via a property with a default value are not registered as #changed.
When looking at the reason why this happens, I also found that any attribute set using "resource.attribute[:foo]" doesn't register as #changed.
It seems Helpers::DynamicAttributes methods [] & []= aren't overriding the HashWithIndifferentAccess methods, why I don't know.
By changing the way you set the default values, to self.send("#{key}=", value), I can get the desired outcome, however, the resource.attributes[key]= remains an issue.
I can create a PR for the above, but at the end of the day, the underlying problems remains.
Metadata
Metadata
Assignees
Labels
No labels