OSDN Git Service

update license test
[pettanr/pettanr.git] / app / models / license.rb
index fd286d1..11252f8 100644 (file)
@@ -11,6 +11,9 @@ class License < ActiveRecord::Base
       :name => cl.name, :url => cl.url, :cc_by => cl.cc_by, :cc_sa => cl.cc_sa, :cc_nd => cl.cc_nd, :cc_nc => cl.cc_nc, 
       :no_resize => cl.no_resize, :no_flip => cl.no_flip, :no_convert => cl.no_convert, :keep_aspect_ratio => cl.keep_aspect_ratio
     }
+    if cl.new_record? and l.new_record? == false
+      l.errors.add :base, 'dupulicate url'
+    end
     l
   end