Import lithium roles into groups

This commit is contained in:
Vinoth Kannan 2018-05-16 17:26:15 +05:30
parent 5e97a9bfb7
commit ade7c94b43
1 changed files with 6 additions and 5 deletions

View File

@ -53,6 +53,7 @@ class ImportScripts::Lithium < ImportScripts::Base
@max_start_id = Post.maximum(:id) @max_start_id = Post.maximum(:id)
import_groups
import_categories import_categories
import_users import_users
import_topics import_topics
@ -70,15 +71,15 @@ class ImportScripts::Lithium < ImportScripts::Base
puts "", "importing groups..." puts "", "importing groups..."
groups = mysql_query <<-SQL groups = mysql_query <<-SQL
SELECT usergroupid, title SELECT DISTINCT name
FROM usergroup FROM roles
ORDER BY usergroupid ORDER BY name
SQL SQL
create_groups(groups) do |group| create_groups(groups) do |group|
{ {
id: group["usergroupid"], id: group["name"],
name: @htmlentities.decode(group["title"]).strip name: @htmlentities.decode(group["name"]).strip
} }
end end
end end