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

Fix deprecation warning on Rails 6.0 #51

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

y-yagi
Copy link

@y-yagi y-yagi commented Mar 10, 2020

In Rails 6.0 the API for template handlers is changing, a template handler must now take two arguments [1], the template and the source, otherwise you will see the following deprecation warning:

DEPRECATION WARNING: Single arity template handlers are deprecated. Template handlers must
now accept two parameters, the view object and the source for the view object.
Change:
  >> #<Faml::RailsHandler:0x0000561d54608868>.call(template)
To:
  >> #<Faml::RailsHandler:0x0000561d54608868>.call(template, source)

This fixes that deprecation warning.

[1] https://www.github.com/rails/rails/commit/28f88e0074

Render_template matcher uses `assert_template` and `assert_template`
has been extracted to `rails-controller-testing` gem.
In Rails 6.0 the API for template handlers is changing, a template
handler must now take two arguments [1], the template and the source,
otherwise you will see the following deprecation warning:

```
DEPRECATION WARNING: Single arity template handlers are deprecated. Template handlers must
now accept two parameters, the view object and the source for the view object.
Change:
  >> #<Faml::RailsHandler:0x0000561d54608868>.call(template)
To:
  >> #<Faml::RailsHandler:0x0000561d54608868>.call(template, source)
```

[1] https://www.github.com/rails/rails/commit/28f88e0074
@coveralls
Copy link

Coverage Status

Coverage decreased (-55.5%) to 43.592% when pulling 819cff5 on y-yagi:support_rails60 into 4f2a60a on eagletmt:master.

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