myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3733] branches/packs/Rakefile: added rake task t


From: noreply
Subject: [myexperiment-hackers] [3733] branches/packs/Rakefile: added rake task to detect out-of-date checklists and runs them
Date: Fri, 27 Sep 2013 11:54:30 +0000 (UTC)

Revision
3733
Author
dgc
Date
2013-09-27 11:54:30 +0000 (Fri, 27 Sep 2013)

Log Message

added rake task to detect out-of-date checklists and runs them

Modified Paths

Diff

Modified: branches/packs/Rakefile (3732 => 3733)


--- branches/packs/Rakefile	2013-09-27 11:53:54 UTC (rev 3732)
+++ branches/packs/Rakefile	2013-09-27 11:54:30 UTC (rev 3733)
@@ -360,3 +360,13 @@
   conn.execute('UPDATE content_blobs SET sha1 = SHA1(data), md5 = MD5(data)')
 end
 
+desc 'Run out-of-date checklists'
+task "myexp:checklists:update" do
+  require File.dirname(__FILE__) + '/config/environment'
+
+  ResearchObject.all.each do |ro|
+    ro.checklists.each do |checklist|
+      checklist.run_checklist! if ro.updated_at > checklist.updated_at
+    end
+  end
+end

reply via email to

[Prev in Thread] Current Thread [Next in Thread]