OSDN Git Service

create vmds; copy vmds
authornomeu <nomeu@users.sourceforge.jp>
Thu, 7 Jul 2011 03:48:58 +0000 (12:48 +0900)
committernomeu <nomeu@users.sourceforge.jp>
Thu, 7 Jul 2011 03:48:58 +0000 (12:48 +0900)
app/models/vmd.rb [new file with mode: 0644]
bin/copy-vmds.rb [new file with mode: 0644]
spec/models/pmd_spec.rb [deleted file]
spec/views/pmds/show.html.erb_spec.rb

diff --git a/app/models/vmd.rb b/app/models/vmd.rb
new file mode 100644 (file)
index 0000000..f90c4eb
--- /dev/null
@@ -0,0 +1,2 @@
+class Vmd < ActiveGroonga::Base
+end
diff --git a/bin/copy-vmds.rb b/bin/copy-vmds.rb
new file mode 100644 (file)
index 0000000..a2f1f70
--- /dev/null
@@ -0,0 +1,6 @@
+Record::Vmd.all(:include => :arc).each do |rec|
+  vmd = Vmd.new
+  vmd.arc = rec.arc.code
+  vmd.path = rec.path
+  vmd.save
+end
diff --git a/spec/models/pmd_spec.rb b/spec/models/pmd_spec.rb
deleted file mode 100644 (file)
index 0c2ee37..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-require 'spec_helper'
-
-describe Pmd do
-  pending "add some examples to (or delete) #{__FILE__}"
-end
index bfd078e..a8a7b62 100644 (file)
@@ -3,7 +3,7 @@ require 'spec_helper'
 describe "pmds/show.html.erb" do
   before do
     @arc = stub_model(Record::Arc)
-    @pmd = stub_model(Pmd, :arc => @arc)
+    @pmd = stub_model(Record::Pmd, :arc => @arc)
     assign :pmd, @pmd
   end
   it do