Replies: 1 comment
-
Assuming that the context is something external to the model class, easiest thing would be to add an attr_accessor or something that you can use to set the context, and and call the reader method inside before_destroy. Then call the writer method before calling destroy on the model instance. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I have a Sequel Model that references files stored in a filesystem and a
before_destroy
hook that deletes the files. It looks something like this:This works alright, but the FileStore API was updated to also require a context object to be passed in. Any advice on what I should do here?
Beta Was this translation helpful? Give feedback.
All reactions