Skip to content

Flatten and check exception class whitelisting with a method#632

Merged
lgebhardt merged 1 commit intoJSONAPI-Resources:masterfrom
vijoc:flatten-exception-class-whitelist
Feb 26, 2016
Merged

Flatten and check exception class whitelisting with a method#632
lgebhardt merged 1 commit intoJSONAPI-Resources:masterfrom
vijoc:flatten-exception-class-whitelist

Conversation

@vijoc
Copy link
Copy Markdown
Contributor

@vijoc vijoc commented Feb 24, 2016

I just spent an embarrassingly long time chasing down the reason why my exceptions were not passed through, after adding them to the configuration as config.exception_class_whitelist << [MyError]. This, of course, caused a nested Array to be stored and the checks failed to account for that.

This PR extracts the exception class whitelist checking to a new method and adds a flatten to the chain to avoid just these kinds of situations.

* Move repeated code to a new method
* Add #flatten to the chain to avoid situations where a nested array is
  silently accepted, but exceptions are not passed through
lgebhardt added a commit that referenced this pull request Feb 26, 2016
Flatten and check exception class whitelisting with a method
@lgebhardt lgebhardt merged commit 4356b85 into JSONAPI-Resources:master Feb 26, 2016
@lgebhardt
Copy link
Copy Markdown
Contributor

@vijoc Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants