This area of the docs addressses my question:
(It’s possible i myself even contributed those docs years ago!)
I think what the docs describe used to be true (maybe in shrine 2), but I’m having trouble with it.
Using ActiveRecord integration, if I do:
photo.image_attacher.add_metadata("foo" => "bar")
photo.image.metadata #=> { ..., "foo" => "bar" }
photo.save # persist changes
photo.reload
photo.image.metadata # does NOT include `"foo" => "bar"`
The save
does not seem to actually save the new metadata. I think using image_attacher.add_metadata
somehow doesn’t result in the column being recognized as changed and needing saving.
Does anyone have any ideas? Thanks!