Replace nil checks in Quoting with a NullColumn. #14091

Closed
wants to merge 1 commit into from

4 participants

@patricksrobertson

This commit takes the nil check in the Connection adapters and replaces it with an
implementation of the NullObject pattern to avoid uncessary code branching. I would
have preferred to inject the NullColumn object directly, instead of using a nilguard,
but was unable to locate the code that passes a nil argument into the quote method.

Even without that injection, this eliminates three code branches that weren't necessary.

@patricksrobertson patricksrobertson Replace nil checks in quoting with a NullColumn.
This commit takes the nil check in the Connection adapters and replaces it with an
implementation of the NullObject pattern to avoid uncessary code branching. I would
have preferred to inject the NullColumn object directly, instead of using a nilguard,
but was unable to locate the code that passes a nil argument into the quote method.
b428e07
@senny
Ruby on Rails member

Internals have changed since this PR was submitted. I'm not sure it's still necessary.

/cc @sgrif

@sgrif
Ruby on Rails member

That is correct.

@sgrif sgrif closed this Aug 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment