intridea/grape — pull request #199 by ppadron (2012-07-04 21:22:24+00:00)
Title: Named params must use symbols as keys so they can be merged with route params

If you define a route with named params and add a route description with parameter info, parameters will be duplicated.

Example:

``` ruby
desc 'retrieves an account', :params => { :username => "account username" }
get '/accounts/:username' do
...
end
```
The `route.route_params` hash is created by merging the info provided to the `desc` method and the named parameters extracted from the path.

The problem is that when Grape extracts the named parameters, it creates a hash where keys are strings instead of symbols. Since the standard way of describing parameters is using symbols, when Grape merges them the result is:

``` ruby
{
"username" => "", # extracted by grape
:username => "account username" # user provided
}
```

This patch makes Grape convert the named parameters to symbols, so that the merge results in:

``` ruby
{
:username => "account username"
}
```