intridea/grape — pull request #416 by seanmoon (2013-05-29 09:35:52+00:00)
Title: Fix #383: Inherit settings correctly when performing nested mounts

Fixes https://github.com/intridea/grape/issues/383

Also fixes the test shown here https://github.com/seanmoon/grape/commit/bc3b04872ee21bb6de4e958a56365348ec979249 but I didn't include the test in this commit as it's redundant and it turned out to be `api.rb`, not `endpoint.rb` that needed the update anyway.

This does not fix https://github.com/intridea/grape/issues/369 but it may improve situations where the `prefix` DSL has been used, but not when the mount point is set dynamically.

May be able to fix that issue with a little more digging.

I also confirmed that the `before` is being called in the correct order (inner child last) when you have nested `before`s using this code.

Since we can't predict when `mount` may be called on an API, I think we will need to propagate the settings each time recursively as this code does.