myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3071] trunk/app/models: added contribution check


From: noreply
Subject: [myexperiment-hackers] [3071] trunk/app/models: added contribution check to solr rankings
Date: Thu, 2 Aug 2012 16:02:57 +0000 (UTC)

Revision
3071
Author
dgc
Date
2012-08-02 16:02:57 +0000 (Thu, 02 Aug 2012)

Log Message

added contribution check to solr rankings

Modified Paths

Diff

Modified: trunk/app/models/blob.rb (3070 => 3071)


--- trunk/app/models/blob.rb	2012-08-02 14:58:02 UTC (rev 3070)
+++ trunk/app/models/blob.rb	2012-08-02 16:02:57 UTC (rev 3071)
@@ -61,8 +61,10 @@
 
   def rank
 
+    boost = 0
+
     # initial boost depends on viewings count
-    boost = contribution.viewings_count / 100
+    boost = contribution.viewings_count / 100 if contribution
 
     # Take curation events into account
     boost += CurationEvent.curation_score(CurationEvent.find_all_by_object_type_and_object_id('Blob', id))

Modified: trunk/app/models/pack.rb (3070 => 3071)


--- trunk/app/models/pack.rb	2012-08-02 14:58:02 UTC (rev 3070)
+++ trunk/app/models/pack.rb	2012-08-02 16:02:57 UTC (rev 3071)
@@ -931,8 +931,10 @@
   
   def rank
 
+    boost = 0
+
     # initial boost depends on viewings count
-    boost = contribution.viewings_count / 100
+    boost = contribution.viewings_count / 100 if contribution
 
     # Take curation events into account
     boost += CurationEvent.curation_score(CurationEvent.find_all_by_object_type_and_object_id('Pack', id))

Modified: trunk/app/models/workflow.rb (3070 => 3071)


--- trunk/app/models/workflow.rb	2012-08-02 14:58:02 UTC (rev 3070)
+++ trunk/app/models/workflow.rb	2012-08-02 16:02:57 UTC (rev 3071)
@@ -258,8 +258,10 @@
 
   def rank
 
+    boost = 0
+
     # initial boost depends on viewings count
-    boost = contribution.viewings_count / 100
+    boost = contribution.viewings_count / 100 if contribution
 
     # Take curation events into account
     boost += CurationEvent.curation_score(CurationEvent.find_all_by_object_type_and_object_id('Workflow', id))

reply via email to

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