Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dry up code in app/models/doi.rb #1242

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ def reference_ids
end

def reference_count
reference_events.pluck(:target_doi).compact.map(&:downcase).uniq.length
reference_ids.length
end

def indexed_references
Expand All @@ -1290,7 +1290,7 @@ def citation_ids

# remove duplicate citing source dois
def citation_count
citation_events.pluck(:source_doi).compact.map(&:downcase).uniq.length
citation_ids.length
end

# remove duplicate citing source dois,
Expand All @@ -1311,7 +1311,7 @@ def part_ids
end

def part_count
part_events.pluck(:target_doi).compact.map(&:downcase).uniq.length
part_ids.length
end

def indexed_parts
Expand All @@ -1323,7 +1323,7 @@ def part_of_ids
end

def part_of_count
part_of_events.pluck(:source_doi).compact.map(&:downcase).uniq.length
part_of_ids.length
end

def indexed_part_of
Expand All @@ -1335,7 +1335,7 @@ def version_ids
end

def version_count
version_events.pluck(:target_doi).compact.map(&:downcase).uniq.length
version_ids.length
end

def indexed_versions
Expand All @@ -1347,7 +1347,7 @@ def version_of_ids
end

def version_of_count
version_of_events.pluck(:source_doi).compact.map(&:downcase).uniq.length
version_of_ids.length
end

def indexed_version_of
Expand Down