ccocchi / rabl-rails

Rails 4.2+ templating system with JSON, XML and Plist support.
MIT License
209 stars 51 forks source link

single arity deprecation warning for Rails 6.1 #94

Closed nicksoto closed 3 years ago

nicksoto commented 4 years ago
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:
  >> RablRails::Handlers::Rabl.call(template)
To:
  >> RablRails::Handlers::Rabl.call(template, source)

A potential change here would be:

module RablRails
  module Handlers
    class Rabl
      def self.call(template, source=nil)
        %{
          RablRails::Library.instance.
            get_rendered_template(#{(source || template.source).inspect}, self, local_assigns)
        }
      end
    end
  end
end
navidemad commented 4 years ago

It will be amazing if you may merge it into master 👍

ccocchi commented 3 years ago

Thank you. The warning have been removed in version 0.6.0 🙂