Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update Artefact importer

  • Loading branch information...
commit ec166f6510be477f8547dd0fbc17f8c1c212fd2b 1 parent c025538
Jamie Cobbett jamiecobbett authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/tasks/move_to_new_sections.rake
5 lib/tasks/move_to_new_sections.rake
View
@@ -62,14 +62,15 @@ module NewSectionMigration
def self.tag_content_with_new_sections
ensure_file_exists!(args[:content_csv])
csv_obj = CSV.new(File.read(args[:content_csv]), {headers: :first_row, return_headers: false})
- # eg: [slug_of_content,section_slug,section_slug,section_slug...]
+ # eg: [title,slug_of_content,section_slug,section_slug,section_slug...]
csv_obj.each do |csv_row|
row = csv_row.fields
- clean_slug = clean_slug(row[0])
+ clean_slug = clean_slug(row[1])
a = Artefact.where(slug: clean_slug).first
if a.nil?
raise "Stop! Artefact '#{clean_slug}' could not be found."
end
+ row.shift # remove the artefact title
row.shift # remove the artefact slug
sections = []
clean_section_slugs = row.map(&:parameterize)
Please sign in to comment.
Something went wrong with that request. Please try again.