Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise middleware deletion #2

Open
wants to merge 4 commits into
base: middleware-stack
Choose a base branch
from
Open

Revise middleware deletion #2

wants to merge 4 commits into from

Conversation

naw
Copy link

@naw naw commented Feb 21, 2017

This is a suggested addendum to rails#27936

Specifically it addresses the issue mentioned here: rails#27936 (comment)

It also restores previous behavior so that deleting a middleware deletes all instances of the middleware in the stack, rather than just the first one.

Currently, this branch uses the deleted location, not the new location.
1. insertions relative to deleted middleware should operate according to the location of the deleted middleware as if the middleware had never been deleted.
2. deleting a middleware should delete all instances of it in the stack (this is current Rails behavior, but former commits in this tree changed it)
1. inserting relative to a deleted middleware should act as if the middleware had not been deleted
2. deleting a middleware should delete all instances of it in the stack
Formerly this was only being tested for `use`.

Now, it's being tested for `use`, `insert`, `insert_before`, `insert_after`, `swap`, and `unshift`

Since I changed some of the code affecting this, it seemed prudent to add more thorough coverage.
@naw
Copy link
Author

naw commented Feb 21, 2017

This also addresses rails#27936 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants