Show newest screenshots first
This commit is contained in:
parent
9db16ab357
commit
e5ceab72a9
1 changed files with 2 additions and 2 deletions
|
|
@ -8,11 +8,11 @@ module PackagesHelper
|
||||||
def screenshots_visible_to_user(package)
|
def screenshots_visible_to_user(package)
|
||||||
if user_signed_in?
|
if user_signed_in?
|
||||||
# User is an admin
|
# User is an admin
|
||||||
package.screenshots
|
package.screenshots.order('created_at DESC')
|
||||||
else
|
else
|
||||||
package.screenshots.where(
|
package.screenshots.where(
|
||||||
"approved=true OR uploaderhash=?", session[:token]
|
"approved=true OR uploaderhash=?", session[:token]
|
||||||
)
|
).order('created_at DESC')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue