diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-10-25 17:27:24 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-10-25 17:27:24 +0000 |
commit | a658679d29ebebe6f68d9292fcb00e973002cb70 (patch) | |
tree | 4b1d8452cfbab5164acfe886c287bfc948a1d8e6 /lib/redmine/activity | |
parent | 06fff6295cecd8f1a9186ab740fd9542035c18ba (diff) | |
download | redmine-a658679d29ebebe6f68d9292fcb00e973002cb70.tar.gz redmine-a658679d29ebebe6f68d9292fcb00e973002cb70.zip |
Add etag check on the activity view to avoid rendering when not modified.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2982 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/activity')
-rw-r--r-- | lib/redmine/activity/fetcher.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/redmine/activity/fetcher.rb b/lib/redmine/activity/fetcher.rb index 1d0bd8a16..fb73d5d28 100644 --- a/lib/redmine/activity/fetcher.rb +++ b/lib/redmine/activity/fetcher.rb @@ -66,6 +66,7 @@ module Redmine end # Returns an array of events for the given date range + # sorted in reverse chronological order def events(from = nil, to = nil, options={}) e = [] @options[:limit] = options[:limit] @@ -76,8 +77,9 @@ module Redmine end end + e.sort! {|a,b| b.event_datetime <=> a.event_datetime} + if options[:limit] - e.sort! {|a,b| b.event_date <=> a.event_date} e = e.slice(0, options[:limit]) end e |