fulcrologic / fulcro-rad

Fulcro Rapid Application Development
MIT License
201 stars 46 forks source link

fo/default-value cause :before values in diff to be non-nil even for new entities #103

Closed holyjak closed 1 year ago

holyjak commented 1 year ago

When saving a new RAD entity I expect all :before values to be nil but this is not the case when the attribute has a default value set via fo/default-value ~or if it is of the :enum type~ - in both these cases there will be :before and :after having the same value (the default ~/ the selected enum value~). This confuses some DB plugins, such as fulcro-rad-asami, ending up with not saving the values at all.

holyjak commented 1 year ago

Correction - enums ok

There is actually no problem with enums. The reason for them having the same before, after is that my form failed to validate and/or safe and when I retried, it somehow saw these values as unchanged even though the entity was not saved. Most likely just some mistake on my side.

awkay commented 1 year ago

Fixed by using latest version of Fulcro.