diff --git a/models/site.rb b/models/site.rb index 886b43ed..5c9df0f9 100644 --- a/models/site.rb +++ b/models/site.rb @@ -166,6 +166,7 @@ class Site < Sequel::Model MAX_COMMENTS_PER_DAY = 5 SANDBOX_TIME = 14.days BLACK_BOX_WAIT_TIME = 10.seconds + MAX_DISPLAY_FOLLOWS = 56*3 many_to_many :tags @@ -568,8 +569,8 @@ class Site < Sequel::Model follows_dataset.all end - def profile_follows_actioning_ids - follows_dataset.select(:actioning_site_id).exclude(:sites__site_changed => false).all + def profile_follows_actioning_ids(limit=nil) + follows_dataset.select(:actioning_site_id).exclude(:sites__site_changed => false).limit(limit).all end =begin diff --git a/views/_follows.erb b/views/_follows.erb index d9e1a6aa..851257e7 100644 --- a/views/_follows.erb +++ b/views/_follows.erb @@ -1,8 +1,8 @@ -<% site_followings = site.followings %> -<% if (!is_current_site && !site_followings.empty?) || is_current_site %> +<% site_followings = site.followings_dataset.count %> +<% if (!is_current_site && site_followings > 0) || is_current_site %>
You are not following any sites yet. Add some by browsing sites or looking at your tags. <% else %> <% site.followings_dataset.select(:site_id).all.each do |following| %> @@ -12,17 +12,22 @@