Commit 605fc702 by Kevin Chugh

update rake file

parent 4aefab34
......@@ -6,15 +6,32 @@ roots['production'] = "http://edx.org"
ROOT = roots[ENV['SINATRA_ENV']]
namespace :flags do
#USAGE
#SINATRA_ENV=development rake flags:flagged
task :flagged => :environment do
flagged = Content.flagged
courses = {}
flagged.each do |f|
if f.attributes.include? "comment_thread_id"
id = f.comment_thread_id
else
id = f.id
if not courses[f.course_id]
courses[f.course_id] = []
end
courses[f.course_id] << f
end
courses.each do |k,v|
puts "#{k.upcase}"
puts "****************"
v.each do |f|
puts "#{ROOT}/courses/#{f.course_id}/discussion/forum/#{f.commentable_id}/threads/#{f.comment_thread_id} (#{f.class})"
end
puts "#{ROOT}/courses/#{f.course_id}/discussion/forum/#{f.commentable_id}/threads/#{id}"
puts "\n\n\n\n"
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment