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 update_unique_name(options = {})
    reload 
    return true unless default_name
    [default_name.name, name].uniq.each do |candidate|
      candidate = candidate.gsub(/[\.\'\?\!\\\/]/, '').downcase
      return if unique_name == candidate
      next if Taxon.exists?(:unique_name => candidate)
      Taxon.update_all(["unique_name = ?", candidate], ["id = ?", self])
      break
    end
  end
def update_unique_name ( options = { } ) reload return true unless default_name [ default_name . name , name ] . uniq . each do | candidate | candidate = candidate . gsub ( / [ \. \' \? \! \\ \/ ] / , '' ) . downcase return if unique_name == candidate next if Taxon . exists? ( :unique_name => candidate ) Taxon . update_all ( [ "unique_name = ?" , candidate ] , [ "id = ?" , self ] ) break end 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 .
# there's a chance taxon names have been created since load
options