avatar

25

added :order to find_with

by abloke, 01 Feb, 2007 05:05 PM
24 25  
4343   # options are :culprit, :referenced, :activity_loggable, :limit
4444   def self.find_with(options={})
4545     limit = (options.delete(:limit) || 10)
46     order = options.delete(:order)
4647     conditions = self.build_sql_conditional_for(options)
47     self.find(:all, :conditions => conditions, :limit => limit)
48   # rescue
49   #   raise "I couldn't run the find with the options you gave me, sorry"
48     self.find(:all, :conditions => conditions, :limit => limit, :order => order)
5049   end
5150 
5251 private