caxlsx / caxlsx_rails

A Rails plugin to provide templates for the axlsx gem
MIT License
742 stars 84 forks source link

Compatibility with Rails 6: Single arity template handlers are deprecated. #112

Closed ashleyHutton closed 5 years ago

ashleyHutton commented 5 years ago

Rails 6 update is causing this 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:
  >> ActionView::Template::Handlers::AxlsxBuilder#call(template)
To:
  >> ActionView::Template::Handlers::AxlsxBuilder#call(template, source)
 (called from <main> at /app/config/environment.rb:5)

I'm guessing the fix is in template_handler.rb:

def call(template)
 ...
end

should be

def call(template, source)
 ...
end
straydogstudio commented 5 years ago

Thanks @ashleyHutton . I've not looked at Rails 6 yet. Was there a documentation url with the error?

ashleyHutton commented 5 years ago

@straydogstudio no, but it looks like this deprecation warning was introduced in 28f88e0 as part of #35119.

teohm commented 5 years ago

@straydogstudio Since Rails 6.0 has been released, by any chance we can release a new version for this gem?

straydogstudio commented 5 years ago

I'll see what I can do. I'm probably going to fork axlsx into a community organization and move axlsx_rails into it. axlsx_rails needs a release of axlsx to fix several issues.

straydogstudio commented 5 years ago

@teohm New version released. 0.6.0. Matches with the new 3.0.0 caxlsx gem.