Closed lsylvester closed 8 years ago
Thanks
hey @lsylvester - @domcleal created a Rails 5 fixture test over in PR #668 and I'm getting failures on this line:
finder.digest_cache[cache_key] = stored_digest = Digestor.new(name, finder, options).digest
(in his branch, it's currently located here: https://github.com/domcleal/rabl/blob/ruby-compatibility/lib/rabl/digestor/rails5.rb#L22)
In an interactive debug session, I basically get to Digestor.new
and it throws wrong number of arguments (3 for 0) occured
for Digestor.new(name, finder, options).digest
. Which makes sense because the signature for that class is:
module Rabl
class Digestor < ActionView::Digestor
def self.digest(name:, finder:, **options)
The Rails 4.x Digestor is instantiated and takes in just options for digest. So that works.
The Rails 5 Digestor doesn't have an initializer and the 3rd parameter is actually the dependencies and not the options.
I assume it's not actually supposed to call itself recursively because you'd get:
Digestor.digest(name: name, finder: finder, dependencies: dependencies)
*** ThreadError Exception: deadlock; recursive locking
So any hints on how to get the digestor to work in a vanilla Rails 5 fixture app? Does the Digestor call work in Rails 5 for you?
When running with rails 5 and
perform_caching = true
I was getting the erroruninitialized class variable @@cache in Rabl::Digester
It seems that the
ActionView::Digester
has been changed and was no longer compatible with theRabl::Digester
overrides.This updates the digest implementation for raise 5 apps top not use the
@@cache
and copies across thepre_stored
check because I think that any Rabl template could have the same issues as the rails partial templates.