Module: FastlyRails::ActiveRecord::SurrogateKey

Extended by:
ActiveSupport::Concern
Defined in:
lib/fastly-rails/active_record/surrogate_key.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#fastly_service_identifierObject


52
53
54
# File 'lib/fastly-rails/active_record/surrogate_key.rb', line 52

def fastly_service_identifier
  self.class.fastly_service_identifier
end

#purgeObject


36
37
38
# File 'lib/fastly-rails/active_record/surrogate_key.rb', line 36

def purge
  FastlyRails.purge_by_key(record_key)
end

#purge_allObject


44
45
46
# File 'lib/fastly-rails/active_record/surrogate_key.rb', line 44

def purge_all
  self.class.purge_all
end

#record_keyObject


28
29
30
# File 'lib/fastly-rails/active_record/surrogate_key.rb', line 28

def record_key
  "#{table_key}/#{id}"
end

#soft_purgeObject


40
41
42
# File 'lib/fastly-rails/active_record/surrogate_key.rb', line 40

def soft_purge
  FastlyRails.purge_by_key(record_key, true)
end

#soft_purge_allObject


48
49
50
# File 'lib/fastly-rails/active_record/surrogate_key.rb', line 48

def soft_purge_all
  self.class.soft_purge_all
end

#table_keyObject


32
33
34
# File 'lib/fastly-rails/active_record/surrogate_key.rb', line 32

def table_key
  self.class.table_key
end