mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Add rubocop to our build. (#5004)
This commit is contained in:
@ -1,6 +1,4 @@
|
||||
|
||||
|
||||
|
||||
###
|
||||
###
|
||||
### The output of this importer is bad.
|
||||
@ -12,14 +10,6 @@
|
||||
###
|
||||
###
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Import from Zoho.
|
||||
# Be sure to get the posts CSV file, AND the user list csv file with people's email addresses.
|
||||
# You may need to contact Zoho support for the user list.
|
||||
@ -64,7 +54,7 @@ class ImportScripts::Zoho < ImportScripts::Base
|
||||
|
||||
def import_users
|
||||
puts "", "Importing users"
|
||||
create_users( CSV.parse(File.read(File.join(@path, 'users.csv'))) ) do |u|
|
||||
create_users(CSV.parse(File.read(File.join(@path, 'users.csv')))) do |u|
|
||||
username = cleanup_zoho_username(u[0])
|
||||
{
|
||||
id: username,
|
||||
@ -105,10 +95,10 @@ class ImportScripts::Zoho < ImportScripts::Base
|
||||
|
||||
# Create categories
|
||||
@categories.each do |parent, subcats|
|
||||
c = create_category({name: parent}, parent)
|
||||
c = create_category({ name: parent }, parent)
|
||||
subcats.each do |subcat|
|
||||
next if subcat == "Uncategorized" || subcat == "Uncategorised"
|
||||
create_category({name: subcat, parent_category_id: c.id}, "#{parent}:#{subcat}")
|
||||
create_category({ name: subcat, parent_category_id: c.id }, "#{parent}:#{subcat}")
|
||||
end
|
||||
end
|
||||
|
||||
@ -217,7 +207,6 @@ class ImportScripts::Zoho < ImportScripts::Base
|
||||
CGI.unescapeHTML(x)
|
||||
end
|
||||
|
||||
|
||||
def import_post_id(row)
|
||||
# Try to make up a unique id based on the data Zoho gives us.
|
||||
# The posted_time seems to be the same for all posts in a topic, so we can't use that.
|
||||
|
Reference in New Issue
Block a user