myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3176] trunk: Sped up group index page


From: noreply
Subject: [myexperiment-hackers] [3176] trunk: Sped up group index page
Date: Mon, 5 Nov 2012 10:53:09 +0000 (UTC)

Revision
3176
Author
fbacall
Date
2012-11-05 10:53:09 +0000 (Mon, 05 Nov 2012)

Log Message

Sped up group index page

Modified Paths

Diff

Modified: trunk/app/models/network.rb (3175 => 3176)


--- trunk/app/models/network.rb	2012-11-02 15:15:56 UTC (rev 3175)
+++ trunk/app/models/network.rb	2012-11-05 10:53:09 UTC (rev 3176)
@@ -166,21 +166,15 @@
                           
   # Finds all the contributions that have been explicitly shared via Permissions
   def shared_contributions
-    list = []
-    self.permissions.each do |p|
-      p.policy.contributions.each do |c|
-        list << c unless c.nil? || c.contributable.nil?
-      end
-    end
-    list
+    Contribution.find(:all,
+                      :select     => "contributions.*",
+                      :joins      => "JOIN policies p on (contributions.policy_id = p.id) JOIN permissions e on (p.id = e.policy_id)",
+                      :conditions => [ "e.contributor_id=? AND e.contributor_type = 'Network'", id ])
   end
   
   # Finds all the contributables that have been explicitly shared via Permissions
   def shared_contributables
-    c = shared_contributions.map do |c| c.contributable end
-
-    # filter out blogs until they've gone completely
-    c.select do |x| x.class != Blog end
+    shared_contributions.map {|c| c.contributable }
   end
 
   # New member policy

Modified: trunk/public/stylesheets/styles.css (3175 => 3176)


--- trunk/public/stylesheets/styles.css	2012-11-02 15:15:56 UTC (rev 3175)
+++ trunk/public/stylesheets/styles.css	2012-11-05 10:53:09 UTC (rev 3176)
@@ -269,7 +269,7 @@
 #hlist {
 	margin: 0;
 	padding-left: 1em;
-  padding-left: 2em;
+  padding-right: 1em;
 }
 
 #hlist ul {

reply via email to

[Prev in Thread] Current Thread [Next in Thread]