Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

team notes from former users for mmsd

#809

District wanted additional data in export, which doesn't include team notes from users that left district. This is something I should look into (former users and how they are handled) but for now provided a one off zipfile with the content.

de = DistrictExport.new d

us = User.joins(:student_comments).where("username like '#{d.id}%'").select("users.id,district_user_id").uniq;nil de.generate_csv("users","id,district_user_id",us.to_sql)

sc = StudentComment.joins(:user).where("users.username like '#{d.id}%'")
de.generate_csv("student_comments", de.csv_cols(StudentComment),sc.to_sql)

assets = Asset.where(attachable_type: "StudentComment").where(attachable_id: sc.pluck(:id))
de.generate_csv('assets',Asset.column_names.join(","),assets.to_sql)

File.open("former_user_tnotes.list", "w") do |f|
f.puts assets.collect(&:document).compact.collect(&:path).compact.collect{|e| e.split("documents/").last}.join("\n")
end
f.puts

mv former_user_tnotes.list public/system/documents/

zip former_user_tnote_assets.zip -r -@ < former_user_tnotes.list

Reported by shawn (at vegantech) · January 2nd, 2015 @ 12:54 AM

State: open
Milestone: August 1
Assigned to: shawn (at vegantech) shawn (at vegantech)

Activity

No comments yet.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.