2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 09:10:25 +08:00

FEATURE: Zoho importer

This commit is contained in:
Neil Lalonde 2015-12-03 10:12:06 -05:00
parent 80bdc7333c
commit 08e10c2a9d
3 changed files with 269 additions and 1 deletions

View file

@ -366,7 +366,6 @@ class ImportScripts::Base
end
new_category = create_category(params, params[:id])
@lookup.add_category(params[:id], new_category)
created += 1
end
@ -396,6 +395,8 @@ class ImportScripts::Base
new_category.custom_fields["import_id"] = import_id if import_id
new_category.save!
@lookup.add_category(import_id, new_category)
post_create_action.try(:call, new_category)
new_category
@ -645,6 +646,23 @@ class ImportScripts::Base
end
end
def update_user_signup_date_based_on_first_post
puts "", "setting users' signup date based on the date of their first post"
total_count = User.count
progress_count = 0
User.find_each do |user|
first = user.posts.order('created_at ASC').first
if first
user.created_at = first.created_at
user.save!
end
progress_count += 1
print_status(progress_count, total_count)
end
end
def html_for_upload(upload, display_filename)
@uploader.html_for_upload(upload, display_filename)
end