From c3c202f59ec3cd9cbece487fa3286b63b714d264 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 27 Jan 2015 15:22:38 -0500 Subject: [PATCH] import approval state of users in Ning import script --- script/import_scripts/ning.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/script/import_scripts/ning.rb b/script/import_scripts/ning.rb index 8700a55dd..1c6414ff3 100644 --- a/script/import_scripts/ning.rb +++ b/script/import_scripts/ning.rb @@ -69,13 +69,20 @@ class ImportScripts::Ning < ImportScripts::Base if staff_levels.include?(u["level"].downcase) if u["level"].downcase == "admin" || u["level"].downcase == "owner" newuser.admin = true - newuser.save else newuser.moderator = true - newuser.save end end + # states: ["active", "suspended", "left", "pending"] + if u["state"] == "active" + newuser.approved = true + newuser.approved_by_id = @system_user.id + newuser.approved_at = newuser.created_at + end + + newuser.save + if u["profilePhoto"] photo_path = file_full_path(u["profilePhoto"]) if File.exists?(photo_path)