Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-10-21 15:25:42 +0400
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2011-10-21 15:25:42 +0400
commit66c6782361d49ef2c9c4be912016c7c24cc42c8f (patch)
tree346c1afab61fc3fb1c090392df97723734794b35 /app
parentec1d69379b447e00d74e04bebed071093f29eb7b (diff)
fixed wall --all option
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects_controller.rb17
1 files changed, 8 insertions, 9 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 5ccfe4bb342..54d19af7511 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -83,16 +83,15 @@ class ProjectsController < ApplicationController
#
def wall
- @date = case params[:view]
- when "week" then Date.today - 7.days
- when "all" then nil
- when "day" then Date.today
- else nil
- end
-
- @notes = @project.common_notes.order("created_at DESC")
- @notes = @date ? @notes.since(@date.at_beginning_of_day) : @notes.fresh.limit(10)
@note = Note.new
+ @notes = @project.common_notes.order("created_at DESC")
+
+ @notes = case params[:view]
+ when "week" then @notes.since((Date.today - 7.days).at_beginning_of_day)
+ when "all" then @notes.all
+ when "day" then @notes.since(Date.today.at_beginning_of_day)
+ else @notes.fresh.limit(10)
+ end
end
#