Skip to content
Snippets Groups Projects
Unverified Commit 9178f79c authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

missing references to build connections

parent 9549ea35
No related branches found
No related tags found
No related merge requests found
...@@ -91,7 +91,9 @@ class Research::Journal::Paper < ApplicationRecord ...@@ -91,7 +91,9 @@ class Research::Journal::Paper < ApplicationRecord
end end
def references def references
people references = people + [journal]
references << volume if volume.present?
references
end end
def doi_url def doi_url
......
...@@ -44,7 +44,6 @@ class Research::Journal::Volume < ApplicationRecord ...@@ -44,7 +44,6 @@ class Research::Journal::Volume < ApplicationRecord
belongs_to :journal, foreign_key: :research_journal_id belongs_to :journal, foreign_key: :research_journal_id
has_many :papers, foreign_key: :research_journal_volume_id, dependent: :nullify has_many :papers, foreign_key: :research_journal_volume_id, dependent: :nullify
has_many :communication_websites, -> { distinct }, through: :journal
has_many :people, -> { distinct }, through: :papers has_many :people, -> { distinct }, through: :papers
scope :ordered, -> { order(number: :desc, published_at: :desc) } scope :ordered, -> { order(number: :desc, published_at: :desc) }
...@@ -63,6 +62,10 @@ class Research::Journal::Volume < ApplicationRecord ...@@ -63,6 +62,10 @@ class Research::Journal::Volume < ApplicationRecord
active_storage_blobs active_storage_blobs
end end
def references
[journal]
end
def path def path
"/#{published_at&.year}-#{slug}" if published_at "/#{published_at&.year}-#{slug}" if published_at
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment