Skip to content

Commit

Permalink
missing type genus test
Browse files Browse the repository at this point in the history
  • Loading branch information
proceps committed Dec 6, 2013
1 parent 5c34234 commit 029e40e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/protonym.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,18 @@ def sv_validate_coordinated_names
end

def sv_type_placement
# type of this taxon is not included in this taxon
if !!self.type_taxon_name
unless self.unavailable_or_invalid?
soft_validations.add(:base, "The type should be included in this #{self.rank_class.rank_name}") unless self.type_taxon_name.ancestors.include?(self)
else
end
end
# this taxon is a type, but not included in nominal taxon
if !!self.type_of_taxon_names
unless self.unavailable_or_invalid?
self.type_of_taxon_names.each do |t|
soft_validations.add(:base, "This taxon is type of #{t.rank_class.rank_name} but is not included there") unless self.type_taxon_name.ancestors.include?(t)
soft_validations.add(:base, "This taxon is type of #{t.rank_class.rank_name} #{t.name} but is not included there") unless self.type_taxon_name.ancestors.include?(t)
end
else
end
Expand Down

0 comments on commit 029e40e

Please sign in to comment.