pboucher
7/18/2017 - 10:11 PM

Find users' custom home pages on hosted sites for data analysis.

Find users' custom home pages on hosted sites for data analysis.

site = ENV["RAILS_ENV"]
HumanUser.find(:all, :conditions=>{:retirement_date=>nil}).each do |u|
    next if u.custom_home_page.nil? || ['inbox', 'my_tasks', 'new_user_welcome'].include?(u.custom_home_page.page_type)

    data = ["DATA_LINE",site]
    data << u.login
    data << u.permission_rule_set.display_name
    data << u.custom_home_page.id
    data << u.custom_home_page.name || ''
    data << u.custom_home_page.page_type || ''
    data << u.custom_home_page.entity_type || ''
    output = data.join(',')
    puts output
end