ActiveSupport callbacks

Hi everyone,

I’ve been struggling with something for a while and was hoping someone who knows more about me than this would be able to help. I have this gist: I’m attempting to build in generic callbacks that I can port into a number of our gems here (this is not an invitation for a discussion on the merits of callbacks).

I’ve got them working nicely for before and after callbacks. My issue comes with around callbacks. I can get them to work if I explicitly look for a block argument and call it (as in this line: but I can’t get it to work if I yield (as in this line:

No matter how much I mess with it I can’t get it working. The thing is, I know this is a solvable problem because Rails does this in this file:, so there has to be a way. Unfortunately, I can’t seem to replicate the approach.