app/services/merge_records_service.rb
# Make sure these 2 type of records can be merged.
# Local names can be merged with other local names because
# they are referenced by the same metadata properties.
# Example: The copyright holder of an Image could be a Person
# or an Organization (both local names), but it can't be a
# Topic or an Image record.
# Local subjects can be merged with other local subjects for
# the same reason.
Make sure these 2 type of records can be merged.
Local names can be merged with other local names because
they are referenced by the same metadata properties.
Example: The copyright holder of an Image could be a Person
or an Organization (both local names), but it can't be a
Topic or an Image record.
Local subjects can be merged with other local subjects for
the same reason.
Make sure these 2 type of records can be merged . Local names can be merged with other local names because they are referenced by the same metadata properties . Example : The copyright holder of an Image could be a Person or an Organization ( both local names ) but it can ' t be a Topic or an Image record . Local subjects can be merged with other local subjects for the same reason .
def validate_compatible_merge
      both_local_names = [old_reference, new_reference].all? do |ref|
        LocalAuthority.local_name_authority?(ref)
      end
      both_local_subjects = [old_reference, new_reference].all? do |ref|
        LocalAuthority.local_subject_authority?(ref)
      end
      return if both_local_names || both_local_subjects
      raise IncompatibleMergeError,
            "Error: Cannot merge records "\
            "that are not the same type of local authority."
    end
def validate_compatible_merge both_local_names = [ old_reference , new_reference ] . all? do | ref | LocalAuthority . local_name_authority? ( ref ) end both_local_subjects = [ old_reference , new_reference ] . all? do | ref | LocalAuthority . local_subject_authority? ( ref ) end return if both_local_names || both_local_subjects raise IncompatibleMergeError , "Error: Cannot merge records " "that are not the same type of local authority." end
Make sure these 2 type of records can be merged.
Make sure these 2 type of records can be merged .