My first suggestion would be that maybe the database design could be
improved. If there are tables with common fields then possibly the
common data should be moved to a separate table, or perhaps even the
two original tables should be merged. It is a nightmare trying to
keep tables with common data in sync.
Note that there are columns in EventDescription (like ‘email’ in your
‘B’ above) that are not present in JudgedEvent (your ‘A’), but slice’ing
them doesn’t affect the attributes hash that will be passed on to the
.new method. The “extra” columns in the destination that are missing
from the source are effectively ignored, but if the source ever expands
to include any of them, then they will be automagically* included.
-Rob
*(no actual magic involved)
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.