Fix all the trailing whitespace

This commit is contained in:
Jakub Arnold
2013-02-07 16:45:24 +01:00
parent 1839614bcc
commit 61654ab8f0
230 changed files with 1165 additions and 1165 deletions

View File

@ -11,8 +11,8 @@ class ExcerptController < ApplicationController
case route[:controller]
when 'topics'
# If we have a post number, retrieve the last post. Otherwise, first post.
# If we have a post number, retrieve the last post. Otherwise, first post.
topic_posts = Post.where(topic_id: route[:topic_id].to_i).order(:post_number)
post = route.has_key?(:post_number) ? topic_posts.last : topic_posts.first
guardian.ensure_can_see!(post)
@ -22,14 +22,14 @@ class ExcerptController < ApplicationController
user = User.where(username_lower: route[:username].downcase).first
guardian.ensure_can_see!(user)
render :json => user, serializer: UserExcerptSerializer, root: false
when 'list'
when 'list'
if route[:action] == 'category'
category = Category.where(slug: route[:category]).first
guardian.ensure_can_see!(category)
render :json => category, serializer: CategoryExcerptSerializer, root: false
end
else
render nothing: true, status: 404
render nothing: true, status: 404
end
rescue ActionController::RoutingError, Discourse::NotFound