List layout made less cluttered

This commit is contained in:
Christoph Haas 2018-05-29 16:49:14 +02:00
parent 969abda5da
commit 24a27e3a0e
2 changed files with 16 additions and 8 deletions

View file

@ -26,6 +26,15 @@ class Package < ApplicationRecord
# order('name ASC')
# }
# Return the first paragraph of the long description.
def long_description_first_paragraph
if self.long_description
self.long_description.split(/\n\.\n/).first
else
nil
end
end
# Return a query of all packages that have screenshots
def self.with_screenshots
# Query for all packages who's ID appears in a screenshot's "package_id" field