Commit cc29a49720253d4703e67b0b023a74d3a3c6e14f

Authored by Carlos Purificação
Committed by Antonio Terceiro
1 parent f6f306c5

Fix rails 4 caching expiration

Signed-off-by: Carlos Purificacao <carloseugenio@gmail.com>
Acked-by: Antonio Terceiro <terceiro@colivre.coop.br>
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 &lt; 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 &lt; 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
... ...