Authorisation management using CanCanCan added
This commit is contained in:
parent
51be4a4777
commit
7a3b65fe50
24 changed files with 211 additions and 295 deletions
|
|
@ -53,7 +53,7 @@ class Package < ApplicationRecord
|
|||
|
||||
# Return a list of packages that have screenshots to be moderated
|
||||
def self.need_moderation
|
||||
Package.joins(:screenshots).where('screenshots.approved=false or screenshots.markedfordelete=true').distinct(:name)
|
||||
Package.joins(:screenshots).where('screenshots.approved=false').distinct(:name)
|
||||
end
|
||||
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ class Package < ApplicationRecord
|
|||
|
||||
# Return a query of all approved/public screenshots of this package
|
||||
def screenshots_pending
|
||||
self.screenshots.where('approved=false or markedfordelete=true')
|
||||
self.screenshots.where('approved=false')
|
||||
end
|
||||
|
||||
# Return a list of packages that have unapproved screenshots
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue