diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d89a3b6..cf0a233 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1310,4 +1310,8 @@ module ApplicationHelper ) + content_tag('span', ' | ', :class => 'comment-footer comment-footer-hide') end end + + def cache_timeout(key, timeout, &block) + cache(key, { :expires_in => timeout }, &block) + end end diff --git a/app/helpers/sweeper_helper.rb b/app/helpers/sweeper_helper.rb index 48a6f9e..8540c66 100644 --- a/app/helpers/sweeper_helper.rb +++ b/app/helpers/sweeper_helper.rb @@ -4,9 +4,7 @@ module SweeperHelper ActionController::Base.new().expire_fragment(*args) end - def expire_timeout_fragment(*args) - ActionController::Base.new().expire_timeout_fragment(*args) - end + alias :expire_timeout_fragment :expire_fragment def expire_friends(profile) # public friends page diff --git a/app/views/friends/index.rhtml b/app/views/friends/index.rhtml index d2f3e3c..9a97bcb 100644 --- a/app/views/friends/index.rhtml +++ b/app/views/friends/index.rhtml @@ -2,7 +2,7 @@

<%= __("%s's friends") % profile.name %>

-<% cache_timeout(profile.manage_friends_cache_key(params), 4.hours.from_now) do %> +<% cache_timeout(profile.manage_friends_cache_key(params), 4.hours) do %> <% if @friends.empty? %>

diff --git a/app/views/profile/_common.rhtml b/app/views/profile/_common.rhtml index 69b4099..f543901 100644 --- a/app/views/profile/_common.rhtml +++ b/app/views/profile/_common.rhtml @@ -9,7 +9,7 @@ <% unless @action %> - <% cache_timeout(profile.cache_key + '-profile-general-info', 4.hours.from_now) do %> + <% cache_timeout(profile.cache_key + '-profile-general-info', 4.hours) do %> <%= _('Content') %> diff --git a/app/views/profile/_person_profile.rhtml b/app/views/profile/_person_profile.rhtml index e6bffab..bfd19e3 100644 --- a/app/views/profile/_person_profile.rhtml +++ b/app/views/profile/_person_profile.rhtml @@ -23,7 +23,7 @@ <%= display_field(_('e-Mail:'), profile, :email, true) { |email| link_to_email(email) } %> <% end %> - <% cache_timeout(profile.relationships_cache_key, 4.hours.from_now) do %> + <% cache_timeout(profile.relationships_cache_key, 4.hours) do %> <% if !(profile.organization.blank? && profile.organization_website.blank?) && (profile.active_fields.include?('organization') || profile.active_fields.include?('organization_website')) %> <%= _('Work')%> diff --git a/app/views/profile/communities.rhtml b/app/views/profile/communities.rhtml index 22e0252..8ecb9eb 100644 --- a/app/views/profile/communities.rhtml +++ b/app/views/profile/communities.rhtml @@ -2,7 +2,7 @@

<%= _("%s's communities") % profile.name %>

-<% cache_timeout(profile.communities_cache_key(params), 4.hour.from_now) do %> +<% cache_timeout(profile.communities_cache_key(params), 4.hour) do %>