Skip to content

Commit

Permalink
@brzaik points out a more efficient way to check moderation privilege…
Browse files Browse the repository at this point in the history
…s for a feed
  • Loading branch information
augustf committed May 7, 2012
1 parent 2b13fa4 commit eab0599
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/controllers/submissions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class SubmissionsController < ApplicationController

def index
@this_feed = Feed.find(params[:feed_id])
can_moderate_feed = can?(:update, @this_feed)
@sub_feeds = @this_feed.children
@submissions = Submission.where(:feed_id => params[:feed_id])

Expand Down
2 changes: 1 addition & 1 deletion app/views/submissions/_index_body.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<br />
<%= submission.content.start_time.strftime("%m/%d") %> to <%= submission.content.end_time.strftime("%m/%d") %>
<br />
<% if can? :update, @submission %>
<% if can_moderate_feed? %>
<p>
<%= link_to "#", :class => "dropdown-control dd-moderate", :title => "Moderate '#{ submission.content.name }'", :rel => "#moderate_#{ submission.id }" do %>
<% if submission.is_approved? %>
Expand Down

0 comments on commit eab0599

Please sign in to comment.