dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

Mongoid embedded photo model not saving [solution]

Open elithecho opened this issue 8 years ago • 2 comments

Thought this would be helpful to anyone, was facing this issue until I found out what's going on in embedded documents.

When you have Band and Photo model embedded, use cascade_callbacks: true in the embeds_many relation to trigger dragonfly's callback

elithecho avatar Jun 19 '17 16:06 elithecho

thanks - does this answer https://github.com/markevans/dragonfly/issues/359?

markevans avatar Jun 20 '17 14:06 markevans

Seems pretty close.

Without cascade_callbacks, mongoid will not trigger dragonfly's callback so the only field stored is the image_name but not uid.

elithecho avatar Jun 20 '17 14:06 elithecho