Add default search order for screenshots
This commit is contained in:
parent
c6bea9b902
commit
5ce1df07f3
1 changed files with 5 additions and 0 deletions
|
|
@ -2,6 +2,11 @@ class Screenshot < ApplicationRecord
|
|||
belongs_to :package, inverse_of: :screenshots
|
||||
belongs_to :user, inverse_of: :screenshots
|
||||
|
||||
# Default sorting:
|
||||
# - unapproved first (to see them at the top when moderating)
|
||||
# - otherwise show newest first
|
||||
default_scope { order(approved: :asc, created_at: :desc) }
|
||||
|
||||
# Paperclip
|
||||
has_attached_file :image,
|
||||
styles: { :large => '800x600>', :thumb => '160x120>' },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue