Skip to content

Commit

Permalink
Fix incorrect replacement.
Browse files Browse the repository at this point in the history
Use find instead of select since select will find all matches.
  • Loading branch information
nanaya committed Nov 20, 2014
1 parent 0eadf78 commit 1f62210
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/post_controller.rb
Expand Up @@ -420,7 +420,7 @@ def show

@pool_posts = PoolPost.where(:post_id => @post.id).includes(:pool).references(:pool).order("pools.name")
if params[:pool_id] then
@following_pool_post = @pool_posts.to_a.select { |pp| pp.pool_id == params[:pool_id] }
@following_pool_post = @pool_posts.to_a.find { |pp| pp.pool_id == params[:pool_id] }
else
@following_pool_post = @pool_posts.to_a.first
end
Expand Down

0 comments on commit 1f62210

Please sign in to comment.