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

Add support to `Haml::Plugin` for Rails 6 #1008

Merged
merged 1 commit into from Mar 15, 2019

Conversation

Projects
None yet
3 participants
@sebjacobs
Copy link
Contributor

commented Mar 15, 2019

In Rails 6 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:

ActiveSupport::DeprecationException: 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:
  >> Class#call(template)
To:
  >> Class#call(template, source)

I have attempted to retain support for older versions of Rails by
providing a default source of nil.

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

Add support to Haml::Plugin for Rails 6
In Rails 6 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:

```
ActiveSupport::DeprecationException: 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:
  >> Class#call(template)
To:
  >> Class#call(template, source)
```

I have attempted to retain support for older versions of Rails by
providing a default source of `nil`.

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

This comment has been minimized.

Copy link
Member

commented Mar 15, 2019

Yeah, I know this would be the workaround for the currently released Rails 6 beta gems, but I'm not sure whether Aaron's "refactoring" has been all done or still ongoing...

So for now, let's just merge this and wait until another stabler Rails release.

@sebjacobs Thank you for the patch anyway!

@amatsuda amatsuda merged commit 9aa0fbe into haml:master Mar 15, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@morgoth

This comment has been minimized.

Copy link

commented May 10, 2019

@amatsuda Rails 6 is around the corner ;-) - can we have this released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.