Commit 605fc702 by Kevin Chugh

update rake file

parent 4aefab34
...@@ -6,15 +6,32 @@ roots['production'] = "http://edx.org" ...@@ -6,15 +6,32 @@ roots['production'] = "http://edx.org"
ROOT = roots[ENV['SINATRA_ENV']] ROOT = roots[ENV['SINATRA_ENV']]
namespace :flags do namespace :flags do
#USAGE
#SINATRA_ENV=development rake flags:flagged
task :flagged => :environment do task :flagged => :environment do
flagged = Content.flagged flagged = Content.flagged
courses = {}
flagged.each do |f| flagged.each do |f|
if f.attributes.include? "comment_thread_id"
id = f.comment_thread_id if not courses[f.course_id]
else courses[f.course_id] = []
id = f.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 end
puts "#{ROOT}/courses/#{f.course_id}/discussion/forum/#{f.commentable_id}/threads/#{id}" puts "\n\n\n\n"
end end
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