diff --git a/app/controllers/public/profile_controller.rb b/app/controllers/public/profile_controller.rb index 5501e0d..7c23c83 100644 --- a/app/controllers/public/profile_controller.rb +++ b/app/controllers/public/profile_controller.rb @@ -20,7 +20,9 @@ class ProfileController < PublicController end def communities - @communities = profile.communities + if is_cache_expired?(profile.communities_cache_key(params)) + @communities = profile.communities.paginate(:per_page => per_page, :page => params[:npage]) + end end def enterprises diff --git a/app/models/community.rb b/app/models/community.rb index 850590d..0cf01aa 100644 --- a/app/models/community.rb +++ b/app/models/community.rb @@ -44,4 +44,8 @@ class Community < Organization def news(limit = 30, highlight = false) recent_documents(limit, ["articles.type != ? AND articles.highlighted = ?", 'Folder', highlight]) end + + def blocks_to_expire_cache + [MembersBlock] + end end diff --git a/app/views/profile/communities.rhtml b/app/views/profile/communities.rhtml index 22b974b..94375fa 100644 --- a/app/views/profile/communities.rhtml +++ b/app/views/profile/communities.rhtml @@ -3,11 +3,17 @@