Commit 8665815d314724ee92934c6a5c121ad73f3e3b4a
1 parent
873bdbb5
Exists in
master
and in
29 other branches
Move improper cache expiring to a sweeper
Showing
3 changed files
with
11 additions
and
3 deletions
Show diff stats
app/controllers/box_organizer_controller.rb
@@ -82,7 +82,6 @@ class BoxOrganizerController < ApplicationController | @@ -82,7 +82,6 @@ class BoxOrganizerController < ApplicationController | ||
82 | def save | 82 | def save |
83 | @block = boxes_holder.blocks.find(params[:id]) | 83 | @block = boxes_holder.blocks.find(params[:id]) |
84 | @block.update_attributes(params[:block]) | 84 | @block.update_attributes(params[:block]) |
85 | - expire_timeout_fragment(@block.cache_key) | ||
86 | redirect_to :action => 'index' | 85 | redirect_to :action => 'index' |
87 | end | 86 | end |
88 | 87 | ||
@@ -93,7 +92,6 @@ class BoxOrganizerController < ApplicationController | @@ -93,7 +92,6 @@ class BoxOrganizerController < ApplicationController | ||
93 | def remove | 92 | def remove |
94 | @block = Block.find(params[:id]) | 93 | @block = Block.find(params[:id]) |
95 | if @block.destroy | 94 | if @block.destroy |
96 | - expire_timeout_fragment(@block.cache_key) | ||
97 | redirect_to :action => 'index' | 95 | redirect_to :action => 'index' |
98 | else | 96 | else |
99 | session[:notice] = _('Failed to remove block') | 97 | session[:notice] = _('Failed to remove block') |
config/environment.rb
@@ -64,7 +64,7 @@ Rails::Initializer.run do |config| | @@ -64,7 +64,7 @@ Rails::Initializer.run do |config| | ||
64 | makemo | 64 | makemo |
65 | ] | 65 | ] |
66 | unless $PROGRAM_NAME =~ /rake$/ && (ignore_rake_commands.include?(ARGV.first)) | 66 | unless $PROGRAM_NAME =~ /rake$/ && (ignore_rake_commands.include?(ARGV.first)) |
67 | - config.active_record.observers = :article_sweeper, :role_assignment_sweeper, :friendship_sweeper, :category_sweeper | 67 | + config.active_record.observers = :article_sweeper, :role_assignment_sweeper, :friendship_sweeper, :category_sweeper, :block_sweeper |
68 | end | 68 | end |
69 | # Make Active Record use UTC-base instead of local time | 69 | # Make Active Record use UTC-base instead of local time |
70 | # config.active_record.default_timezone = :utc | 70 | # config.active_record.default_timezone = :utc |