Sha256: 5e564b39b49f20eb90c6bba31ea6414a74ca228ec7b037f738cb909feff62b55

Contents?: true

Size: 252 Bytes

Versions: 5

Compression:

Stored size: 252 Bytes

Contents

if defined?(ActiveRecord)
  class ActiveRecord::Base
    def cache_key
      [ self.class.to_s.underscore, to_param,
        ( soft_send(:cached_at).try(:to_i) ||
          soft_send(:updated_at).try(:to_i) )
      ].compact.join "/"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
freighthopper-0.1.14 lib/freighthopper/activerecord/cache_key.rb
freighthopper-0.1.13 lib/freighthopper/activerecord/cache_key.rb
freighthopper-0.1.12 lib/freighthopper/activerecord/cache_key.rb
freighthopper-0.1.11 lib/freighthopper/activerecord/cache_key.rb
freighthopper-0.1.9 lib/freighthopper/activerecord/cache_key.rb