Showing newest and most wanted package on home page
This commit is contained in:
parent
dbca1e0a19
commit
9ad5a05914
3 changed files with 48 additions and 38 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue