Sha256: 7a6439ae6133f4f3a204f2d56519564a7833649608435010604e059d8b0d0f03
Contents?: true
Size: 536 Bytes
Versions: 26
Compression:
Stored size: 536 Bytes
Contents
module Spree module MemoizedData extend ActiveSupport::Concern included do # reset cache on save inside transaction and transaction commit after_save :reset_memoized_data after_commit :reset_memoized_data def reload(options = {}) reset_memoized_data super(options) end private def reset_memoized_data self.class.const_get('MEMOIZED_METHODS').each do |v| instance_variable_set(:"@#{v.gsub(/\?/, '')}", nil) end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems