Fix project imports not working with serialized data
The change in e404c311 broke models that relied on single-type inheritance:
## Before:
CommitStatus.new(type: 'Ci::Build').class
=> Ci::Build
## After the change:
CommitStatus.new.tap{|c| c.assign_attributes(type: 'Ci::Build')}.class
=> CommitStatus
As a result, any serialized options would not be properly saved to the database, leading to errors expecting a Hash
vs. a String
, for example.
This affected all pipelines that used shared runners because the build would error out due to this serialization error.
Closes #34860 (closed)
Edited by 🤖 GitLab Bot 🤖