Fix an issue with proc options in child classes #141

Closed
wants to merge 3 commits into
from

Projects

None yet

3 participants

@Sutto
Sutto commented May 16, 2012

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

@jnunemaker

Should we have a test for using dup as well?

Owner

Good idea - I'll add one shortly.

@Sutto
Sutto commented May 21, 2012

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.

@angelo0000

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.

@angelo0000

Here is the outstanding issue I was referring to: #137

@Sutto
Sutto commented Jun 7, 2012

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.

@Sutto
Sutto commented Jun 9, 2012

@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.

@jnunemaker
Owner

Cool.

@jnunemaker
Owner

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!

@Sutto
Sutto commented Sep 11, 2012

Hey John - Will take a look now (sorry for not getting back to it earlier, I still hadn't worked out a good solution).

@Sutto
Sutto commented Sep 11, 2012

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).

@jnunemaker jnunemaker added a commit that closed this pull request Jan 1, 2013
@jnunemaker Fix proc options in child classes.
Closes #141
33d01c5
@jnunemaker jnunemaker closed this in 33d01c5 Jan 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment