Skip to content

Commit

Permalink
Fix Ruby 2.7 deprecation warning
Browse files Browse the repository at this point in the history
This fixes the warning:

```
ruby/2.7.0/gems/grape-1.4.0/lib/grape/dsl/inside_route.rb: warning:
Using the last argument as keyword parameters is deprecated; maybe **
should be added to the call
```

More details:
https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
  • Loading branch information
stanhu committed Sep 30, 2020
1 parent 7e43215 commit 9b678f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#### Fixes

* Your contribution here.
* [#2104](https://github.com/ruby-grape/grape/pull/2104): Fix Ruby 2.7 keyword deprecation warning - [@stanhu](https://github.com/stanhu).
* [#2103](https://github.com/ruby-grape/grape/pull/2103): Ensure complete declared params structure is present - [@tlconnor](https://github.com/tlconnor).
* [#2099](https://github.com/ruby-grape/grape/pull/2099): Added truffleruby to Travis-CI - [@gogainda](https://github.com/gogainda).
* [#2089](https://github.com/ruby-grape/grape/pull/2089): Specify order of mounting Grape with Rack::Cascade in README - [@jonmchan](https://github.com/jonmchan).
Expand Down
2 changes: 1 addition & 1 deletion lib/grape/dsl/inside_route.rb
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def entity_class_for_obj(object, options)
def entity_representation_for(entity_class, object, options)
embeds = { env: env }
embeds[:version] = env[Grape::Env::API_VERSION] if env[Grape::Env::API_VERSION]
entity_class.represent(object, embeds.merge(options))
entity_class.represent(object, **embeds.merge(options))
end
end
end
Expand Down

0 comments on commit 9b678f4

Please sign in to comment.