Class: Occams::Seeds::Page::Importer
- Defined in:
- lib/occams/seeds/page/importer.rb
Instance Attribute Summary collapse
-
#target_pages ⇒ Object
tracking target page linking.
Attributes inherited from Importer
#from, #path, #seed_ids, #site, #to
Instance Method Summary collapse
- #import! ⇒ Object
-
#initialize(from, to = from) ⇒ Importer
constructor
A new instance of Importer.
Constructor Details
Instance Attribute Details
#target_pages ⇒ Object
tracking target page linking. Since we might be linking to something that doesn’t exist yet, we’ll defer linking to the end of import
7 8 9 |
# File 'lib/occams/seeds/page/importer.rb', line 7 def target_pages @target_pages end |
Instance Method Details
#import! ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/occams/seeds/page/importer.rb', line 14 def import! import_page(File.join(path, 'index/'), nil) link_target_pages # Remove pages not found in seeds site.pages.where('id NOT IN (?)', seed_ids).destroy_all end |