Skip to content

Commit

Permalink
Merge pull request #158 from dmitri-d/use-activesupport-digest
Browse files Browse the repository at this point in the history
Use ActiveSupport::Digest when available
  • Loading branch information
mathieujobin authored Aug 5, 2022
2 parents ffcbaff + 9f33843 commit 161f87b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/angular-rails-templates/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 161f87b

Please sign in to comment.