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))