From 9f33843010154e77d6cba00a62b157e6ac9787c5 Mon Sep 17 00:00:00 2001 From: Dmitri Dolguikh Date: Wed, 18 Apr 2018 11:15:16 -0700 Subject: [PATCH] Use ActiveSupport::Digest when available --- lib/angular-rails-templates/engine.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/angular-rails-templates/engine.rb b/lib/angular-rails-templates/engine.rb index 3c509a8..20467d0 100644 --- a/lib/angular-rails-templates/engine.rb +++ b/lib/angular-rails-templates/engine.rb @@ -37,10 +37,11 @@ class Engine < ::Rails::Engine # Sprockets Cache Busting # If ART's version or settings change, expire and recompile all assets + hash_digest = defined?(ActiveSupport::Digest) ? ActiveSupport::Digest : Digest::MD5 app.config.assets.version = [ app.config.assets.version, 'ART', - Digest::MD5.hexdigest("#{VERSION}-#{app.config.angular_templates}") + hash_digest.hexdigest("#{VERSION}-#{app.config.angular_templates}") ].join '-' end