OSDN Git Service

add test
[pettanr/pettanr.git] / app / models / common_license.rb
index 834ee88..d480437 100644 (file)
@@ -15,4 +15,12 @@ class CommonLicense < ActiveRecord::Base
     res
   end
   
+  def self.import_file(filename)
+    t = File.open(filename, 'r').read
+    j = JSON.parse t
+    l = CommonLicense.new j
+    l.save_save
+    p l.id
+  end
+  
 end