Commit b3e9a31e36fa1b2cdbe2632417212e1032a92233

Authored by Carlos Purificação
1 parent 5a1eee95
Exists in caching-rails4

Fix rails 4 caching expiration

app/helpers/application_helper.rb
... ... @@ -1241,7 +1241,7 @@ module ApplicationHelper
1241 1241 end
1242 1242  
1243 1243 def cache_timeout(key, timeout, &block)
1244   - cache(key, { :expires_in => timeout }, &block)
  1244 + cache(key, { :expires_in => timeout, :skip_digest => true }, &block)
1245 1245 end
1246 1246  
1247 1247 def is_cache_expired?(key)
... ...
app/models/block.rb
... ... @@ -235,7 +235,7 @@ class Block < ActiveRecord::Base
235 235  
236 236 alias :active_record_cache_key :cache_key
237 237 def cache_key(language='en', user=nil)
238   - active_record_cache_key+'-'+language
  238 + active_record_cache_key + '-' + language
239 239 end
240 240  
241 241 def timeout
... ...
plugins/event/lib/event_plugin/event_block.rb
... ... @@ -81,4 +81,8 @@ class EventPlugin::EventBlock < Block
81 81 content_tag(:span, date.year.to_s, :class => 'year')
82 82 end
83 83  
  84 + def self.expire_on
  85 + { :profile => [:article], :environment => [:article] }
  86 + end
  87 +
84 88 end
... ...