aboutsummaryrefslogblamecommitdiffstats
path: root/actiontext/lib/action_text/attachments/caching.rb
blob: 7c727bfc26ce7dad031db39847c8651742b7ef26 (plain) (tree)
1
2
3

                             
                 












                                                                               
# frozen_string_literal: true

module ActionText
  module Attachments
    module Caching
      def cache_key(*args)
        [self.class.name, cache_digest, *attachable.cache_key(*args)].join("/")
      end

      private
        def cache_digest
          Digest::SHA256.hexdigest(node.to_s)
        end
    end
  end
end