Rescue when member plugin's publication_date is nil
This commit is contained in:
parent
8af5112d24
commit
01ca178060
|
@ -91,9 +91,10 @@ class WritingBook
|
||||||
title << self.publisher if self.publisher.present?
|
title << self.publisher if self.publisher.present?
|
||||||
title << self.isbn if self.isbn.present?
|
title << self.isbn if self.isbn.present?
|
||||||
|
|
||||||
|
if !self.publish_date.nil?
|
||||||
pd = self.publish_date.strftime("%Y-%m-%d").split('-')
|
pd = self.publish_date.strftime("%Y-%m-%d").split('-')
|
||||||
|
|
||||||
title << pd[0]+"/"+pd[1]
|
title << pd[0]+"/"+pd[1]
|
||||||
|
end
|
||||||
|
|
||||||
# title << "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})"
|
# title << "(#{self.journal_level_types.collect{|x| x.title}.join(', ')})"
|
||||||
title.join(', ')
|
title.join(', ')
|
||||||
|
|
|
@ -88,9 +88,11 @@ class WritingConference
|
||||||
|
|
||||||
title << self.authors if self.authors.present?
|
title << self.authors if self.authors.present?
|
||||||
|
|
||||||
|
if !self.publication_date.nil?
|
||||||
pd = self.publication_date.strftime("%Y-%m-%d").split('-')
|
pd = self.publication_date.strftime("%Y-%m-%d").split('-')
|
||||||
|
|
||||||
title << pd[0]
|
title << pd[0]
|
||||||
|
end
|
||||||
|
|
||||||
title << self.paper_title if self.paper_title.present?
|
title << self.paper_title if self.paper_title.present?
|
||||||
title << self.conference_title if self.conference_title.present?
|
title << self.conference_title if self.conference_title.present?
|
||||||
title << self.location if self.location.present?
|
title << self.location if self.location.present?
|
||||||
|
|
|
@ -94,9 +94,10 @@ class WritingJournal
|
||||||
|
|
||||||
title << self.authors if self.authors.present?
|
title << self.authors if self.authors.present?
|
||||||
|
|
||||||
|
if !self.publication_date.nil?
|
||||||
pd = self.publication_date.strftime("%Y-%m-%d").split('-')
|
pd = self.publication_date.strftime("%Y-%m-%d").split('-')
|
||||||
|
|
||||||
title << pd[0]
|
title << pd[0]
|
||||||
|
end
|
||||||
title << self.paper_title if self.paper_title.present?
|
title << self.paper_title if self.paper_title.present?
|
||||||
title << self.journal_title if self.journal_title.present?
|
title << self.journal_title if self.journal_title.present?
|
||||||
title << self.vol_no if (self.vol_no.present? && self.vol_no != "0")
|
title << self.vol_no if (self.vol_no.present? && self.vol_no != "0")
|
||||||
|
|
Loading…
Reference in New Issue