aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_text/attachments/caching.rb
blob: b0194170e1808d7a449b80a9c79b1b4db807efb8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module ActiveText
  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