OSDN Git Service
(root)
/
pettanr
/
pettanr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add url validator
[pettanr/pettanr.git]
/
app
/
models
/
license.rb
diff --git
a/app/models/license.rb
b/app/models/license.rb
index
11252f8
..
3226b2d
100644
(file)
--- a/
app/models/license.rb
+++ b/
app/models/license.rb
@@
-2,7
+2,7
@@
class License < ActiveRecord::Base
has_one :original_license
has_one :common_license
validates :name, :presence => true, :length => {:maximum => 50}
has_one :original_license
has_one :common_license
validates :name, :presence => true, :length => {:maximum => 50}
- validates :url, :presence => true, :length => {:maximum => 200}, :uniqueness => true
+ validates :url, :presence => true, :length => {:maximum => 200}, :uniqueness => true
, :url => {:allow_blank => true}
def self.update_license cl
l = License.find_by_url cl.url
def self.update_license cl
l = License.find_by_url cl.url