It is now possible to ignore draft posts on import.
* refactored the code sent by SustainableWebsites * made the ignore feature optional via ENV variable * added docs
This commit is contained in:
@@ -18,11 +18,13 @@ namespace :wordpress do
|
||||
dump = Refinery::WordPress::Dump.new(params[:file_name])
|
||||
|
||||
dump.authors.each(&:to_refinery)
|
||||
dump.posts.each(&:to_refinery)
|
||||
|
||||
only_published = ENV['ONLY_PUBLISHED'] == 'true' ? true : false
|
||||
dump.posts(only_published).each(&:to_refinery)
|
||||
|
||||
ENV["MODEL"] = 'BlogPost'
|
||||
Rake::Task["friendly_id:redo_slugs"].invoke
|
||||
ENV["MODEL"] = nil
|
||||
ENV.delete("MODEL")
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user