app/models/taxon.rb
# Sometimes you don't want to make a new taxon name with a taxon, like when
# you're saving a new taxon name with a new associated taxon. Hence, this.
Sometimes you don't want to make a new taxon name with a taxon, like when
you're saving a new taxon name with a new associated taxon. Hence, this.
Sometimes you don ' t want to make a new taxon name with a taxon like when you ' re saving a new taxon name with a new associated taxon . Hence this .
def graft(options = {})
    ratatosk.graft(self, options)
  rescue RatatoskGraftError, Timeout::Error, NameProviderError => e
    if species_or_lower? && name.split(' ').size > 1
      parent_name = name.split(' ')[0..-2].join(' ')
      parent = Taxon.single_taxon_for_name(parent_name)
      parent ||= Taxon.import(parent_name, :exact => true)
      if parent && rank_level && parent.rank_level && parent.rank_level > rank_level
        self.update_attributes(:parent => parent)
      end
    end
    raise e unless grafted?
  end
def graft ( options = { } ) ratatosk . graft ( self , options ) rescue RatatoskGraftError , Timeout :: Error , NameProviderError => e if species_or_lower? && name . split ( ' ' ) . size > 1 parent_name = name . split ( ' ' ) [ 0 .. - 2 ] . join ( ' ' ) parent = Taxon . single_taxon_for_name ( parent_name ) parent ||= Taxon . import ( parent_name , :exact => true ) if parent && rank_level && parent . rank_level && parent . rank_level > rank_level self . update_attributes ( :parent => parent ) end end raise e unless grafted? end
Sometimes you don't want to make a new taxon name with a taxon, like when
you're saving a new taxon name with a new associated taxon.
Sometimes you don ' t want to make a new taxon name with a taxon like when you ' re saving a new taxon name with a new associated taxon .
options