summaryrefslogtreecommitdiffstats
path: root/app/controllers/boards_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-03 21:30:10 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-03 21:30:10 +0000
commitea296a109a8655ea48c02c1d0a9bb0d19002d236 (patch)
tree08b5e517e77e341cfdd5a23d649dd1e754074dd4 /app/controllers/boards_controller.rb
parenta7023dfa9b8e39e6e0a73e57d22823e8a4260b71 (diff)
downloadredmine-ea296a109a8655ea48c02c1d0a9bb0d19002d236.tar.gz
redmine-ea296a109a8655ea48c02c1d0a9bb0d19002d236.zip
Replaces find(:first/:all) calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10931 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/boards_controller.rb')
-rw-r--r--app/controllers/boards_controller.rb19
1 files changed, 12 insertions, 7 deletions
diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb
index cea2cd3bd..faf88647c 100644
--- a/app/controllers/boards_controller.rb
+++ b/app/controllers/boards_controller.rb
@@ -43,17 +43,22 @@ class BoardsController < ApplicationController
@topic_count = @board.topics.count
@topic_pages = Paginator.new self, @topic_count, per_page_option, params['page']
- @topics = @board.topics.reorder("#{Message.table_name}.sticky DESC").order(sort_clause).all(
- :include => [:author, {:last_reply => :author}],
- :limit => @topic_pages.items_per_page,
- :offset => @topic_pages.current.offset)
+ @topics = @board.topics.
+ reorder("#{Message.table_name}.sticky DESC").
+ includes(:author, {:last_reply => :author}).
+ limit(@topic_pages.items_per_page).
+ offset(@topic_pages.current.offset).
+ order(sort_clause).
+ all
@message = Message.new(:board => @board)
render :action => 'show', :layout => !request.xhr?
}
format.atom {
- @messages = @board.messages.find :all, :order => 'created_on DESC',
- :include => [:author, :board],
- :limit => Setting.feeds_limit.to_i
+ @messages = @board.messages.
+ reorder('created_on DESC').
+ includes(:author, :board).
+ limit(Setting.feeds_limit.to_i).
+ all
render_feed(@messages, :title => "#{@project}: #{@board}")
}
end