summaryrefslogtreecommitdiffstats
path: root/app/controllers/timelog_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-07-28 10:15:53 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-07-28 10:15:53 +0000
commit0ac3afebc62b37e70b3ab69a4d8d4602671dfb46 (patch)
tree2b497eb9cb2417e325db2f1415cd791883e487e7 /app/controllers/timelog_controller.rb
parentef8dd0f64b709c6695c67877f7bc1f750f5a9396 (diff)
downloadredmine-0ac3afebc62b37e70b3ab69a4d8d4602671dfb46.tar.gz
redmine-0ac3afebc62b37e70b3ab69a4d8d4602671dfb46.zip
Don't use finder options.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12045 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/timelog_controller.rb')
-rw-r--r--app/controllers/timelog_controller.rb15
1 files changed, 3 insertions, 12 deletions
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb
index 96db24fdd..111925cf7 100644
--- a/app/controllers/timelog_controller.rb
+++ b/app/controllers/timelog_controller.rb
@@ -52,13 +52,9 @@ class TimelogController < ApplicationController
respond_to do |format|
format.html {
- # Paginate results
@entry_count = scope.count
@entry_pages = Paginator.new @entry_count, per_page_option, params['page']
- @entries = scope.all(
- :limit => @entry_pages.per_page,
- :offset => @entry_pages.offset
- )
+ @entries = scope.offset(@entry_pages.offset).limit(@entry_pages.per_page).all
@total_hours = scope.sum(:hours).to_f
render :layout => !request.xhr?
@@ -66,15 +62,10 @@ class TimelogController < ApplicationController
format.api {
@entry_count = scope.count
@offset, @limit = api_offset_and_limit
- @entries = scope.preload(:custom_values => :custom_field).all(
- :limit => @limit,
- :offset => @offset
- )
+ @entries = scope.offset(@offset).limit(@limit).preload(:custom_values => :custom_field).all
}
format.atom {
- entries = scope.reorder("#{TimeEntry.table_name}.created_on DESC").all(
- :limit => Setting.feeds_limit.to_i
- )
+ entries = scope.limit(Setting.feeds_limit.to_i).reorder("#{TimeEntry.table_name}.created_on DESC").all
render_feed(entries, :title => l(:label_spent_time))
}
format.csv {