Module: FastlyRails::Mongoid::SurrogateKey

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

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#fastly_service_identifierObject


38
39
40
# File 'lib/fastly-rails/mongoid/surrogate_key.rb', line 38

def fastly_service_identifier
  self.class.fastly_service_identifier
end

#purgeObject


30
31
32
# File 'lib/fastly-rails/mongoid/surrogate_key.rb', line 30

def purge
  FastlyRails.purge_by_key(record_key)
end

#purge_allObject


34
35
36
# File 'lib/fastly-rails/mongoid/surrogate_key.rb', line 34

def purge_all
  self.class.purge_all
end

#record_keyObject


22
23
24
# File 'lib/fastly-rails/mongoid/surrogate_key.rb', line 22

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

#table_keyObject


26
27
28
# File 'lib/fastly-rails/mongoid/surrogate_key.rb', line 26

def table_key
  self.class.table_key
end