Class: Locomotive::Steam::Adapters::Filesystem::Sanitizers::ContentEntry

Inherits:
Object
  • Object
show all
Includes:
Locomotive::Steam::Adapters::Filesystem::Sanitizer
Defined in:
lib/locomotive/steam/adapters/filesystem/sanitizers/content_entry.rb

Instance Attribute Summary

Attributes included from Locomotive::Steam::Adapters::Filesystem::Sanitizer

#scope

Instance Method Summary collapse

Methods included from Locomotive::Steam::Adapters::Filesystem::Sanitizer

#apply_to, #attach_site_to, #setup, #with

Instance Method Details

#apply_to_dataset(dataset) ⇒ Object



15
16
17
18
19
20
# File 'lib/locomotive/steam/adapters/filesystem/sanitizers/content_entry.rb', line 15

def apply_to_dataset(dataset)
  dataset.all.each do |entity|
    _apply_to_dataset(entity, dataset)
  end
  clean
end

#apply_to_entity(entity) ⇒ Object



10
11
12
13
# File 'lib/locomotive/steam/adapters/filesystem/sanitizers/content_entry.rb', line 10

def apply_to_entity(entity)
  super
  add_label(entity)
end

#apply_to_entity_with_dataset(entity, dataset) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/locomotive/steam/adapters/filesystem/sanitizers/content_entry.rb', line 22

def apply_to_entity_with_dataset(entity, dataset)
  # Note: this statement attaches the site to the entity
  apply_to_entity(entity)

  # make sure it gets an unique slug and an _id + set default values
  _apply_to_dataset(entity, dataset)
end