app/models/logging/curator_activity_log.rb
# NOTE: this is an old and (frankly) stupid workaround for not adding the
# taxon_concept_id to the database when building the CAL. I'm keeping it here
# until we'er confident that we're building it correctly, but if you're
# reading this and aren't aware of the problem, it's probably okay to delete
# this method by now. Probably.
this is an old and (frankly) stupid workaround for not adding the
taxon_concept_id to the database when building the CAL.
this is an old and ( frankly ) stupid workaround for not adding the taxon_concept_id to the database when building the CAL .
def deduce_taxon_concept_id
    case changeable_object_type_id
      when ChangeableObjectType.data_object.id
        hierarchy_entry.try(:taxon_concept_id)
      when ChangeableObjectType.comment.id
        if comment_object.parent_type == 'TaxonConcept'
          comment_parent.id
        else
          if comment_parent.user.nil?
            comment_object.taxon_concept_id
          else
            comment_parent.taxon_concept_for_users_text.id
          end
        end
      when ChangeableObjectType.synonym.id
        synonym.hierarchy_entry.try(:taxon_concept_id)
      when ChangeableObjectType.users_data_object.id
        udo_taxon_concept.id
      when ChangeableObjectType.taxon_concept.id
        taxon_concept.id
      when ChangeableObjectType.curated_taxon_concept_preferred_entry.id
        taxon_concept.id
      when ChangeableObjectType.classification_curation.id
        taxon_concept.id
      when ChangeableObjectType.data_point_uri.id
        taxon_concept.id
      when ChangeableObjectType.user_added_data.id
        taxon_concept.id
      when ChangeableObjectType.data_objects_hierarchy_entry.id
        hierarchy_entry.try(:taxon_concept_id)
      else
        raise "Don't know how to get the taxon id from a changeable object type of id #{changeable_object_type_id}"
    end
  end
def deduce_taxon_concept_id case changeable_object_type_id when ChangeableObjectType . data_object . id hierarchy_entry . try ( :taxon_concept_id ) when ChangeableObjectType . comment . id if comment_object . parent_type == 'TaxonConcept' comment_parent . id else if comment_parent . user . nil? comment_object . taxon_concept_id else comment_parent . taxon_concept_for_users_text . id end end when ChangeableObjectType . synonym . id synonym . hierarchy_entry . try ( :taxon_concept_id ) when ChangeableObjectType . users_data_object . id udo_taxon_concept . id when ChangeableObjectType . taxon_concept . id taxon_concept . id when ChangeableObjectType . curated_taxon_concept_preferred_entry . id taxon_concept . id when ChangeableObjectType . classification_curation . id taxon_concept . id when ChangeableObjectType . data_point_uri . id taxon_concept . id when ChangeableObjectType . user_added_data . id taxon_concept . id when ChangeableObjectType . data_objects_hierarchy_entry . id hierarchy_entry . try ( :taxon_concept_id ) else raise "Don't know how to get the taxon id from a changeable object type of id #{changeable_object_type_id}" end end
NOTE: this is an old and (frankly) stupid workaround for not adding the
taxon_concept_id to the database when building the CAL.
NOTE : this is an old and ( frankly ) stupid workaround for not adding the taxon_concept_id to the database when building the CAL .