Skip to content

Commit

Permalink
Add id_str as generic unique id field option (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwalmsley authored Apr 16, 2024
1 parent 0b08176 commit 67e227b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/services/import/reduction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def unique_id
unique_id = subject_metadata['#name']
return unique_id if unique_id

# generic metadata
unique_id = subject_metadata['id_str'] || subject_metadata['!id_str'] || subject_metadata['#id_str']
return unique_id if unique_id

# staging has older data with different subject metadata - fallback to handling this special env case
subject_metadata['!SDSS_ID'] if Rails.env.staging? || Rails.env.test?
end
Expand Down

0 comments on commit 67e227b

Please sign in to comment.