Search backward compatibility

This commit is contained in:
Karel Pičman 2015-05-19 14:44:25 +02:00
parent eaffa3a3c2
commit 53783db85a

View File

@ -82,6 +82,7 @@ class DmsfFile < ActiveRecord::Base
acts_as_event :title => Proc.new { |o| o.name },
:description => Proc.new { |o|
if (Rails::VERSION::MAJOR > 3)
desc = Redmine::Search.cache_store.fetch("DmsfFile-#{o.id}")
if desc
Redmine::Search.cache_store.delete("DmsfFile-#{o.id}")
@ -89,6 +90,9 @@ class DmsfFile < ActiveRecord::Base
else
o.description
end
else
o.description
end
},
:url => Proc.new { |o| {:controller => 'dmsf_files', :action => 'show', :id => o} },
:datetime => Proc.new { |o| o.updated_at },