Showing newest and most wanted package on home page

This commit is contained in:
Christoph Haas 2016-08-23 19:00:39 +02:00
parent dbca1e0a19
commit 9ad5a05914
3 changed files with 48 additions and 38 deletions

View file

@ -100,4 +100,12 @@ class Screenshot < ActiveRecord::Base
self.approved = true
self.save!
end
def self.newest_upload
self.order(updated_at: :desc).first
end
def self.approved
self.find_by(approved: true)
end
end