mrrooijen / mongoid-paperclip

Mongoid::Paperclip enables you to use Paperclip with the Mongoid ODM for MongoDB.
MIT License
344 stars 119 forks source link

embeds_many and paperclip #40

Open patricklehmann opened 11 years ago

patricklehmann commented 11 years ago

I upload a file with the nested_form_for and the params are really stored in the database. The file itself is not stored on the filesystem.

What does not work:

class Video < Product embeds_many :thumbnails

class Thumbnail include Mongoid::Paperclip has_mongoid_attached_file :file embedded_in :product

What does work: class Video < Product has_many :thumbnails

class Thumbnail include Mongoid::Paperclip has_mongoid_attached_file :file belongs_to :product

Can somebody helps me? Because i don't want to store the thumbnails in a own collection.

mike-petersen commented 7 years ago

There still seems to be a problem if you use an embedded model. I switched from embeds_many to has_many and afterwords it worked.

If you use embeds_many the object is stored and the images are processed. But no images apear in the public folder.