Sha256: e01f61f13ac42b921fad24f7527c2389e5abb4db6d1e93de884444bc667af57d
Contents?: true
Size: 872 Bytes
Versions: 4
Compression:
Stored size: 872 Bytes
Contents
# Adds surrogate key methods to ActiveRecord models # Purge methods use a POST over PURGE # The choice of this HTTP method should not effect anything module FastlyRails module ActiveRecord module SurrogateKey extend ActiveSupport::Concern module ClassMethods def purge_all FastlyRails.purge_by_key(table_key) end def table_key table_name end def fastly_service_identifier FastlyRails.service_id end end def record_key "#{table_key}/#{id}" end def table_key self.class.table_key end def purge FastlyRails.purge_by_key(record_key) end def purge_all self.class.purge_all end def fastly_service_identifier self.class.fastly_service_identifier end end end end
Version data entries
4 entries across 4 versions & 1 rubygems