File tree 2 files changed +2
-18
lines changed
2 files changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ class Network < ActiveRecord::Base
31
31
before_save :correct_tags
32
32
before_save :cache_counts!
33
33
after_create :assign_members
34
- after_save :cleanup_orphans
35
34
36
35
scope :most_protips , order ( 'protips_count_cache DESC' )
37
36
scope :featured , where ( featured : true )
@@ -165,8 +164,6 @@ def to_public_hash
165
164
166
165
def protips
167
166
@protips ||= Protip . tagged_with ( self . tags , on : :topics )
168
- #@protips ||= Protip.search(nil, self.tags)
169
-
170
167
end
171
168
172
169
def upvotes
@@ -234,13 +231,6 @@ def assign_members
234
231
end
235
232
end
236
233
237
- def cleanup_orphans
238
- ProcessingQueue . queue ( :orphan_protips ) . each do |orphan |
239
- if orphan . queueable && orphan . queueable . networks . any?
240
- ProcessingQueue . unqueue ( orphan . queueable , :orphan_protips )
241
- end
242
- end
243
- end
244
234
end
245
235
246
236
# == Schema Information
Original file line number Diff line number Diff line change 78
78
h4 Pro tips created in networks in past week
79
79
section
80
80
ul .networks
81
- -Network.all .each do |network|
81
+ -Network.where('protips_count_cache =! 0').order('protips_count_cache desc') .each do |network|
82
82
li .network
83
83
span .name = link_to network.name, network_path(network)
84
84
span .created_at = network.protips.where('created_at > ?', 1.week.ago).count
93
93
-User.most_active_by_country.first(10).each do |user_group|
94
94
li
95
95
span .country = user_group.country
96
- span .count = user_group.count
97
-
98
-
99
- -if Rails.env.development?
100
- . right .clear
101
- h4 =link_to('Toggle Premium Team', url_for(:controller => 'admin', :action => :toggle_premium_team))
102
- . clear
96
+ span .count = user_group.count
You can’t perform that action at this time.
0 commit comments