Skip to content

Commit

Permalink
Clarified submission list composition to close #138 - are the rules c…
Browse files Browse the repository at this point in the history
…orrect?
  • Loading branch information
brzaik committed Jul 15, 2012
1 parent b410c7e commit 1ae373c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions app/controllers/submissions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@ def get_feed

def index
@can_moderate_feed = can?(:update, @feed)
@approved_submissions = @feed.submissions.approved
@approved_submissions = @feed.submissions.approved.active
if @can_moderate_feed
@pending_submissions = @feed.submissions.pending

# pending submissions are defined as submissions that are active (i.e. date window has not passed to make them expired) and flagged as pending via scope:
@pending_submissions = @feed.submissions.pending.active

# denied submissions are defined as all submissions that are marked with moderation false (regardless of expired or active status):
@denied_submissions = @feed.submissions.denied
@expired_submissions = @feed.submissions.expired

# expired submissions include any pending or active submissions that have passed their date windows, but denied submissions are not included (i.e. they're ALWAYS in the "denied" list):
@expired_submissions = @feed.submissions.pending.expired + @feed.submissions.approved.expired

end
#brzNote: did appears to result in a redirect when it is uncommented:
#auth!
Expand Down

0 comments on commit 1ae373c

Please sign in to comment.