Skip to content

Instantly share code, notes, and snippets.

@pboucher
Last active July 18, 2017 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pboucher/9259387100dbc7680f69f4dd1aef6f3a to your computer and use it in GitHub Desktop.
Save pboucher/9259387100dbc7680f69f4dd1aef6f3a to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment