myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [2338] trunk/app/models/contribution.rb: fixed la


From: noreply
Subject: [myexperiment-hackers] [2338] trunk/app/models/contribution.rb: fixed latest and last updated tabs in workflows
Date: Tue, 23 Feb 2010 07:13:34 -0500 (EST)

Revision
2338
Author
dgc
Date
2010-02-23 07:13:33 -0500 (Tue, 23 Feb 2010)

Log Message

fixed latest and last updated tabs in workflows

Modified Paths

Diff

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


--- trunk/app/models/contribution.rb	2010-02-22 17:04:59 UTC (rev 2337)
+++ trunk/app/models/contribution.rb	2010-02-23 12:13:33 UTC (rev 2338)
@@ -45,23 +45,13 @@
   # returns the 'most recent' Contributions
   # the maximum number of results is set by #limit#
   def self.most_recent(limit=10, klass=nil)
-    conditions = ["contributable_type = ?", klass] if klass
-    self.find(:all,
-              :conditions => conditions,
-              :order => "contributions.created_at DESC",
-              :limit => limit,
-              :include => [ { :policy => :permissions } ])
+    Authorization.authorised_index(:type => Object.const_get(klass), :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)
-    conditions = ["contributable_type = ?", klass] if klass
-    self.find(:all,
-              :conditions => conditions,
-              :order => "contributions.updated_at DESC",
-              :limit => limit,
-              :include => [ { :policy => :permissions } ])
+    Authorization.authorised_index(:type => Object.const_get(klass), :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]