Skip to content

Fix kwargs in slotable#399

Merged
joelhawksley merged 1 commit intoViewComponent:masterfrom
eileencodes:fix-kwargs-warnings
Jul 9, 2020
Merged

Fix kwargs in slotable#399
joelhawksley merged 1 commit intoViewComponent:masterfrom
eileencodes:fix-kwargs-warnings

Conversation

@eileencodes
Copy link
Contributor

In GitHub and in these tests the slots_component takes keyword
arguments, not args. The args variable needs to be double splatted
in the initalization caller.

The warnings can be seen when running the tests before this change was
introduced.

Fixes:

view_component/lib/view_component/slotable.rb:98: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
view_component/test/app/components/slots_component.rb:18: warning: The called method `initialize' is defined here

cc/ @joelhawksley

In GitHub and in these tests the slots_component takes keyword
arguments, not `args`. The `args` variable needs to be double splatted
in the initalization caller.

The warnings can be seen when running the tests before this change was
introduced.

Fixes:

```
view_component/lib/view_component/slotable.rb:98: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
view_component/test/app/components/slots_component.rb:18: warning: The called method `initialize' is defined here
```
@joelhawksley joelhawksley merged commit 5b13d52 into ViewComponent:master Jul 9, 2020
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