Should we have an options to create a struct keeping virtual fields if they exist? The canonical example is password when you explicitly don't want to keep the virtual field. But another example of using them is when you have calculated fields you might want to create with select_merge from the db. If you want to update them later it would be good to be able to:
EctoMorph.update_virtual_fields(data, MyStruct) or something.
If you can cast those virtual fields then you can still keep some type safety in them I guess.
Should we have an options to create a struct keeping virtual fields if they exist? The canonical example is password when you explicitly don't want to keep the virtual field. But another example of using them is when you have calculated fields you might want to create with select_merge from the db. If you want to update them later it would be good to be able to: EctoMorph.update_virtual_fields(data, MyStruct) or something.
If you can cast those virtual fields then you can still keep some type safety in them I guess.