13 lines
375 B
Ruby
13 lines
375 B
Ruby
module PackagesHelper
|
|
# Return a query of all screenshots that the current user may see
|
|
# Consists of:
|
|
# - approved (public) screenshots
|
|
# - screenshots uploaded by the user (determined by cookie session)
|
|
def screenshots_visible_to_user
|
|
self.screenshots.where(
|
|
# "approved=true"
|
|
"approved=true OR uploaderhash=?", session[:token]
|
|
)
|
|
end
|
|
|
|
end
|