westonganger / active_snapshot

Simplified snapshots and restoration for ActiveRecord models and associations with a transparent white-box implementation
MIT License
103 stars 16 forks source link

Handling ActiveStorage::Attachment relations within the gem #41

Closed otrub closed 9 months ago

otrub commented 1 year ago

Hello @westonganger,

Thank you for your dedication in creating this gem, it's both compact and easy to understand.

I'm currently facing an issue with ActiveStorage::Attachment relations, it seems to not work as expected due to proxy classes. I understand you suggested embedding the gem directly into my app and customizing the logic. Before I proceed, I'd appreciate your thoughts on this, and any changes you might recommend.

Thank you in advance for your guidance.

westonganger commented 1 year ago

If you didnt want to embed the code directly in your app, then its possible you could just add an additional operation after successfully saving a snapshot AND additional operation after successfully restoring a snapshot.

Could be helpful to others if you provided some code with explanation.