Skip to content

Commit

Permalink
Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
caiosba committed Jan 6, 2024
1 parent ab47a35 commit fdefde4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/models/concerns/project_media_cached_fields.rb
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,15 @@ def recalculate_description
def recalculate_title
title = self.get_title
# Always save the title as a custom title so we can fallback to it in case the title gets blank (for example, title_field is claim title and claim is deleted)
title.blank? ? self.update_column(:title_field, 'custom_title') : self.update_column(:custom_title, title)
title.blank? ? self.custom_title&.to_s : title
if title.blank?
unless self.custom_title.blank?
self.update_column(:title_field, 'custom_title')
title = self.custom_title
end
else
self.update_column(:custom_title, title)
end
title.to_s
end

def recalculate_status
Expand Down

0 comments on commit fdefde4

Please sign in to comment.