I think the issue is actually with how you defined your embeds_many association. Try removing the "as" option completely and see if that fixes the issue.
class Description
include Mongoid::Document
include Mongoid::Timestamps
embeds_many :images, cascade_callbacks: true
end
class Image
include Mongoid::Document
include Mongoid::Timestamps
embedded_in :photo, polymorphic: true
end
Fabrication doesn't attempt to turn attribute names to classes. As long as you have a Fabricator(:image) defined, preferably without the photo
association in it, then you should just be able to do this:
Fabricator(:description) do
images(count: 1)
end