Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
suruja committed Oct 3, 2016
1 parent c4a69f8 commit 503b97b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/rabl/digestor/rails5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ def self.digest(name:, finder:, **options)

pre_stored = finder.digest_cache.put_if_absent(cache_key, false).nil? # put_if_absent returns nil on insertion

finder.digest_cache[cache_key] = stored_digest = Digestor.new(name, finder, options).digest
finder.digest_cache[cache_key] = stored_digest = ActionView::Digestor.digest(
name: name,
finder: finder,
dependencies: options[:dependencies],
)
ensure
# something went wrong or ActionView::Resolver.caching? is false, make sure not to corrupt the @@cache
finder.digest_cache.delete_pair(cache_key, false) if pre_stored && !stored_digest
Expand Down

0 comments on commit 503b97b

Please sign in to comment.