app/models/identification.rb
# Update the observation if you're adding an ID to your own obs
Update the observation if you're adding an ID to your own obs
Update the observation if you ' re adding an ID to your own obs
def update_observation
    return true unless observation
    return true if skip_observation
    attrs = {}
    if user_id == observation.user_id
      observation.skip_identifications = true
      species_guess = observation.species_guess
      unless taxon.taxon_names.exists?(:name => species_guess)
        species_guess = taxon.common_name.try(:name) || taxon.name
      end
      attrs = {:species_guess => species_guess, :taxon_id => taxon_id, :iconic_taxon_id => taxon.iconic_taxon_id}
      ProjectUser.delay(:priority => INTEGRITY_PRIORITY).update_taxa_obs_and_observed_taxa_count_after_update_observation(observation.id, self.user_id)
    end
    observation.identifications.reload
    observation.set_community_taxon(:force => true)
    observation.update_attributes(attrs)
    true
  end
def update_observation return true unless observation return true if skip_observation attrs = { } if user_id == observation . user_id observation . skip_identifications = true species_guess = observation . species_guess unless taxon . taxon_names . exists? ( :name => species_guess ) species_guess = taxon . common_name . try ( :name ) || taxon . name end attrs = { :species_guess => species_guess , :taxon_id => taxon_id , :iconic_taxon_id => taxon . iconic_taxon_id } ProjectUser . delay ( :priority => INTEGRITY_PRIORITY ) . update_taxa_obs_and_observed_taxa_count_after_update_observation ( observation . id , self . user_id ) end observation . identifications . reload observation . set_community_taxon ( :force => true ) observation . update_attributes ( attrs ) true end
Update the observation if you're adding an ID to your own obs
Update the observation if you ' re adding an ID to your own obs
# update the species_guess