Skip to content

Commit

Permalink
Ensure subjects and fieldOfScience fields are unique
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhoads committed Feb 14, 2023
1 parent d02f638 commit 38c3c61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def re3data=(value)
end

def subjects=(value)
write_attribute(:subjects, Array.wrap(value))
write_attribute(:subjects, Array.wrap(value).uniq)
end

def opendoar=(value)
Expand Down
4 changes: 2 additions & 2 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1734,11 +1734,11 @@ def _fos_filter(subject_array)
end

def fields_of_science
_fos_filter(subjects)
_fos_filter(subjects).uniq
end

def fields_of_science_repository
_fos_filter(client&.subjects)
_fos_filter(client&.subjects).uniq
end

def fields_of_science_combined
Expand Down

0 comments on commit 38c3c61

Please sign in to comment.