myexperiment-hackers
[Top][All Lists]
Advanced

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

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


From: noreply
Subject: [myexperiment-hackers] [3760] branches/packs/Rakefile: added rake task to ensure all workflows, files and packs have ROs
Date: Fri, 1 Nov 2013 14:10:24 +0000 (UTC)

Revision
3760
Author
dgc
Date
2013-11-01 14:10:23 +0000 (Fri, 01 Nov 2013)

Log Message

added rake task to ensure all workflows, files and packs have ROs

Modified Paths

Diff

Modified: branches/packs/Rakefile (3759 => 3760)


--- branches/packs/Rakefile	2013-10-21 15:31:21 UTC (rev 3759)
+++ branches/packs/Rakefile	2013-11-01 14:10:23 UTC (rev 3760)
@@ -386,3 +386,19 @@
 
 end
 
+desc 'Ensure all RO enabled models have research objects'
+task "myexp:ro:addmissing" do
+  require File.dirname(__FILE__) + '/config/environment'
+
+  [Workflow, Blob, Pack].each do |model|
+    model.all.each do |record|
+      if record.research_object.nil?
+        ResearchObject.create(
+            :context => record,
+            :slug    => "#{Conf.to_visible(model.name)}#{record.id}",
+            :user    => record.contributor)
+      end
+    end
+  end
+end
+

reply via email to

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