myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [2339] trunk/app/models/contribution.rb: bug fix


From: noreply
Subject: [myexperiment-hackers] [2339] trunk/app/models/contribution.rb: bug fix for home page
Date: Tue, 23 Feb 2010 10:18:26 -0500 (EST)

Revision
2339
Author
dgc
Date
2010-02-23 10:18:26 -0500 (Tue, 23 Feb 2010)

Log Message

bug fix for home page

Modified Paths

Diff

Modified: trunk/app/models/contribution.rb (2338 => 2339)


--- trunk/app/models/contribution.rb	2010-02-23 12:13:33 UTC (rev 2338)
+++ trunk/app/models/contribution.rb	2010-02-23 15:18:26 UTC (rev 2339)
@@ -45,13 +45,13 @@
   # returns the 'most recent' Contributions
   # the maximum number of results is set by #limit#
   def self.most_recent(limit=10, klass=nil)
-    Authorization.authorised_index(:type => Object.const_get(klass), :contribution_records => true, :limit => limit, :order => 'created_at DESC')
+    Authorization.authorised_index(:type => klass ? Object.const_get(klass) : nil, :contribution_records => true, :limit => limit, :order => 'created_at DESC')
   end
   
   # returns the 'last updated' Contributions
   # the maximum number of results is set by #limit#
   def self.last_updated(limit=10, klass=nil)
-    Authorization.authorised_index(:type => Object.const_get(klass), :contribution_records => true, :limit => limit, :order => 'updated_at DESC')
+    Authorization.authorised_index(:type => klass ? Object.const_get(klass) : nil, :contribution_records => true, :limit => limit, :order => 'updated_at DESC')
   end
   
   # returns the 'most favourited' Contributions

reply via email to

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