Skip to content

Commit

Permalink
Taxa and TaxonNames should be valid without sources and source identi…
Browse files Browse the repository at this point in the history
…fiers.
  • Loading branch information
kueda committed Sep 10, 2012
1 parent 4f60606 commit 18abe99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/models/taxon.rb
Expand Up @@ -69,7 +69,8 @@ class Taxon < ActiveRecord::Base
"taxon's parent"
validates_uniqueness_of :source_identifier,
:scope => [:source_id],
:message => "already exists"
:message => "already exists",
:allow_blank => true

NAME_PROVIDER_TITLES = {
'ColNameProvider' => 'Catalogue of Life',
Expand Down
3 changes: 2 additions & 1 deletion app/models/taxon_name.rb
Expand Up @@ -12,7 +12,8 @@ class TaxonName < ActiveRecord::Base
:case_sensitive => false
validates_uniqueness_of :source_identifier,
:scope => [:source_id],
:message => "already exists"
:message => "already exists",
:allow_blank => true

#TODO is the validates uniqueness correct? Allows duplicate TaxonNames to be created with same
#source_url but different taxon_ids
Expand Down

0 comments on commit 18abe99

Please sign in to comment.