gh-2399 prevent casting for discriminator models when pushing to array
Merge pull request #2481 from alabid/gh-2399

gh-2399 prevent casting for discriminator models when pushing to array