You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.