summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-02-16 18:28:46 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-02-16 18:28:46 +0000
commita798a1ac4dc75f5fc64ea7a1e7808fb798f12f97 (patch)
tree4f360066c7c899edc254ebdbdb2dbb1469797907
parent53a04b0a44ca8cc8a2be369234377d6625892e84 (diff)
downloadredmine-a798a1ac4dc75f5fc64ea7a1e7808fb798f12f97.tar.gz
redmine-a798a1ac4dc75f5fc64ea7a1e7808fb798f12f97.zip
Removed fragment caching on gantt and calendar.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1157 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/issues_controller.rb2
-rw-r--r--app/controllers/projects_controller.rb3
-rw-r--r--app/controllers/versions_controller.rb2
-rw-r--r--app/sweepers/issue_sweeper.rb38
-rw-r--r--app/sweepers/project_sweeper.rb40
-rw-r--r--app/sweepers/version_sweeper.rb34
-rw-r--r--app/views/projects/calendar.rhtml2
-rw-r--r--app/views/projects/gantt.rhtml5
8 files changed, 0 insertions, 126 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index b0e82d365..8b3cc339d 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -25,8 +25,6 @@ class IssuesController < ApplicationController
before_filter :authorize, :except => [:index, :changes, :preview, :update_form, :context_menu]
before_filter :find_optional_project, :only => [:index, :changes]
accept_key_auth :index, :changes
-
- cache_sweeper :issue_sweeper, :only => [ :new, :edit, :bulk_edit, :destroy ]
helper :journals
helper :projects
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index cddfb6f81..a3eac71ab 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -29,9 +29,6 @@ class ProjectsController < ApplicationController
before_filter :require_admin, :only => [ :add, :archive, :unarchive, :destroy ]
accept_key_auth :activity, :calendar
- cache_sweeper :project_sweeper, :only => [ :add, :edit, :archive, :unarchive, :destroy ]
- cache_sweeper :version_sweeper, :only => [ :add_version ]
-
helper :sort
include SortHelper
helper :custom_fields
diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb
index 55b3a7fce..aeb802ccb 100644
--- a/app/controllers/versions_controller.rb
+++ b/app/controllers/versions_controller.rb
@@ -20,8 +20,6 @@ class VersionsController < ApplicationController
menu_item :roadmap
before_filter :find_project, :authorize
- cache_sweeper :version_sweeper, :only => [ :edit, :destroy ]
-
def show
end
diff --git a/app/sweepers/issue_sweeper.rb b/app/sweepers/issue_sweeper.rb
deleted file mode 100644
index dc9020535..000000000
--- a/app/sweepers/issue_sweeper.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# redMine - project management software
-# Copyright (C) 2006-2007 Jean-Philippe Lang
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-class IssueSweeper < ActionController::Caching::Sweeper
- observe Issue
-
- def after_save(issue)
- expire_cache_for(issue)
- end
-
- def after_destroy(issue)
- expire_cache_for(issue)
- end
-
-private
- def expire_cache_for(issue)
- # fragments of the main project
- expire_fragment(Regexp.new("projects/(calendar|gantt)/#{issue.project_id}\\."))
- # fragments of the root project that include subprojects issues
- unless issue.project.parent_id.nil?
- expire_fragment(Regexp.new("projects/(calendar|gantt)/#{issue.project.parent_id}\\..*subprojects"))
- end
- end
-end
diff --git a/app/sweepers/project_sweeper.rb b/app/sweepers/project_sweeper.rb
deleted file mode 100644
index f64f6f564..000000000
--- a/app/sweepers/project_sweeper.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# redMine - project management software
-# Copyright (C) 2006-2007 Jean-Philippe Lang
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-class ProjectSweeper < ActionController::Caching::Sweeper
- observe Project
-
- def before_save(project)
- if project.new_record?
- expire_cache_for(project.parent) if project.parent
- else
- project_before_update = Project.find(project.id)
- return if project_before_update.parent_id == project.parent_id && project_before_update.status == project.status
- expire_cache_for(project.parent) if project.parent
- expire_cache_for(project_before_update.parent) if project_before_update.parent
- end
- end
-
- def after_destroy(project)
- expire_cache_for(project.parent) if project.parent
- end
-
-private
- def expire_cache_for(project)
- expire_fragment(Regexp.new("projects/(calendar|gantt)/#{project.id}\\."))
- end
-end
diff --git a/app/sweepers/version_sweeper.rb b/app/sweepers/version_sweeper.rb
deleted file mode 100644
index e1323e261..000000000
--- a/app/sweepers/version_sweeper.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-# redMine - project management software
-# Copyright (C) 2006-2007 Jean-Philippe Lang
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-class VersionSweeper < ActionController::Caching::Sweeper
- observe Version
-
- def after_save(version)
- expire_cache_for(version)
- end
-
- def after_destroy(version)
- expire_cache_for(version)
- end
-
-private
- def expire_cache_for(version)
- # calendar and gantt fragments of the project
- expire_fragment(Regexp.new("projects/(calendar|gantt)/#{version.project_id}\\."))
- end
-end
diff --git a/app/views/projects/calendar.rhtml b/app/views/projects/calendar.rhtml
index 3214d7b06..a2af3e2bb 100644
--- a/app/views/projects/calendar.rhtml
+++ b/app/views/projects/calendar.rhtml
@@ -1,4 +1,3 @@
-<% cache(:year => @year, :month => @month, :tracker_ids => @selected_tracker_ids, :subprojects => params[:with_subprojects], :lang => current_language) do %>
<h2><%= "#{month_name(@month)} #{@year}" %></h2>
<table width="100%">
@@ -20,7 +19,6 @@
<%= image_tag 'arrow_from.png' %>&nbsp;&nbsp;<%= l(:text_tip_task_begin_day) %><br />
<%= image_tag 'arrow_to.png' %>&nbsp;&nbsp;<%= l(:text_tip_task_end_day) %><br />
<%= image_tag 'arrow_bw.png' %>&nbsp;&nbsp;<%= l(:text_tip_task_begin_end_day) %><br />
-<% end %>
<% content_for :sidebar do %>
<h3><%= l(:label_calendar) %></h3>
diff --git a/app/views/projects/gantt.rhtml b/app/views/projects/gantt.rhtml
index 0e252aeae..ece776699 100644
--- a/app/views/projects/gantt.rhtml
+++ b/app/views/projects/gantt.rhtml
@@ -55,8 +55,6 @@ t_height = g_height + headers_height
</table>
<% end %>
-<% cache(:year => @year_from, :month => @month_from, :months => @months, :zoom => @zoom, :tracker_ids => @selected_tracker_ids, :subprojects => params[:with_subprojects], :lang => current_language) do %>
-
<table width="100%" style="border:0; border-collapse: collapse;">
<tr>
<td style="width:<%= subject_width %>px;">
@@ -205,9 +203,6 @@ top = headers_height + 10
<% top = top + 20
end %>
-<% end # cache
-%>
-
<%
#
# Today red line (excluded from cache)