This fixes an issue with serialization issues when using proc options (e.g. disable the rails query string normalizer) introduced by the use of Marshal.dump
Add a fix for the inheritable attribute issue
Make sure we use .dup on lambdas.
Should we have a test for using dup as well?
Good idea - I'll add one shortly.
The more I look at this code, the more it perplexes me slightly (e.g. not behaving exactly as expected).
I'm going to take a look and see what I can do to make it clearer before updating this pull request as well.
I have an issue open that prevents the use of debug_output. I added in a temp fix to resolve my specific issue but do you know if your patch resolves that issue? Your last comment said you needed to make some changes before updating the pull request.. just curious if you have had time to look at it more.
Here is the outstanding issue I was referring to: #137
Indeed it's the same issue - The core issue is using Marshal is a bad way, when you can use dup / clone and check for duplicable objects as an alternative (so it handles it oddly).
The issue I have with the current implementation / why I've been trying to rethink it is that it merges the config every time you access it, which led to even more subtle bugs - the solution being to rework that to be a little less magical. I haven't gotten to look at it yet, will try and get to it today some time.
Ensure we actually dup on certain values.
@angelo0000 @jnunemaker See above for further updates - I'm still not 100% happy, but it works as intended for the moment.
If you're happy with this for the moment, I'll also work on a version that cleans the method up to be a bit simpler.
Any chance you could take a look at this based on master? One of your test cases is failing with master, but I'm not exactly sure what to do about it. Thanks!
Hey John - Will take a look now (sorry for not getting back to it earlier, I still hadn't worked out a good solution).
Just took a look - the failing spec is because it doesn't dup / clone the proc. It should be fine (since that change isn't 100% necessary).
Fix proc options in child classes.