Skip to content

Commit

Permalink
More gremlins
Browse files Browse the repository at this point in the history
  • Loading branch information
j-f1 committed May 20, 2017
1 parent f5f0bd6 commit 243c958
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def post_feedback

def post_reasons
filter = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00"
@reasons = Reason.joins(posts).where(posts_reasons: { post_id: params[:id] }).select(select_fields(filter)).order(id: :desc)
@reasons = Reason.joins(:posts).where(posts_reasons: { post_id: params[:id] }).select(select_fields(filter)).order(id: :desc)
results = @reasons.paginate(page: params[:page], per_page: @pagesize)
render json: { items: results, has_more: has_more?(params[:page], results.count) }
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ def flagged?
end

def flaggers
User.joins(flag_logs).where(flag_logs: { success: true, post_id: id, is_auto: true })
User.joins(:flag_logs).where(flag_logs: { success: true, post_id: id, is_auto: true })
end

def manual_flaggers
User.joins(flag_logs).where(flag_logs: { success: true, post_id: id, is_auto: false })
User.joins(:flag_logs).where(flag_logs: { success: true, post_id: id, is_auto: false })
end

def fetch_revision_count(post = nil)
Expand Down

0 comments on commit 243c958

Please sign in to comment.