Don't use finder options.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12045 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
ef8dd0f64b
commit
0ac3afebc6
@ -52,13 +52,9 @@ class TimelogController < ApplicationController
|
|||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
# Paginate results
|
|
||||||
@entry_count = scope.count
|
@entry_count = scope.count
|
||||||
@entry_pages = Paginator.new @entry_count, per_page_option, params['page']
|
@entry_pages = Paginator.new @entry_count, per_page_option, params['page']
|
||||||
@entries = scope.all(
|
@entries = scope.offset(@entry_pages.offset).limit(@entry_pages.per_page).all
|
||||||
:limit => @entry_pages.per_page,
|
|
||||||
:offset => @entry_pages.offset
|
|
||||||
)
|
|
||||||
@total_hours = scope.sum(:hours).to_f
|
@total_hours = scope.sum(:hours).to_f
|
||||||
|
|
||||||
render :layout => !request.xhr?
|
render :layout => !request.xhr?
|
||||||
@ -66,15 +62,10 @@ class TimelogController < ApplicationController
|
|||||||
format.api {
|
format.api {
|
||||||
@entry_count = scope.count
|
@entry_count = scope.count
|
||||||
@offset, @limit = api_offset_and_limit
|
@offset, @limit = api_offset_and_limit
|
||||||
@entries = scope.preload(:custom_values => :custom_field).all(
|
@entries = scope.offset(@offset).limit(@limit).preload(:custom_values => :custom_field).all
|
||||||
:limit => @limit,
|
|
||||||
:offset => @offset
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
format.atom {
|
format.atom {
|
||||||
entries = scope.reorder("#{TimeEntry.table_name}.created_on DESC").all(
|
entries = scope.limit(Setting.feeds_limit.to_i).reorder("#{TimeEntry.table_name}.created_on DESC").all
|
||||||
:limit => Setting.feeds_limit.to_i
|
|
||||||
)
|
|
||||||
render_feed(entries, :title => l(:label_spent_time))
|
render_feed(entries, :title => l(:label_spent_time))
|
||||||
}
|
}
|
||||||
format.csv {
|
format.csv {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user