avatar

26

Added operators AND and OR for find conditionals

by abloke, 02 Feb, 2007 09:46 AM
17 26  
1414 * Renamed find_for to find_with, the conditions are now stackable
1515 
1616 0.3.2 - 01-02-2007
17 * Refactored the find_with method, and added IN [2,1,6] capability
17 * Refactored the find_with method, and added IN [2,1,6] capability
18 
19 0.3.3 - 01-02-2007
20 * Added operators AND and OR for find conditionals
25 26  
5454     options.each do |key, value|
5555       conditions << self.send(:sanitize_sql, ["#{key.to_s}_id IN (?)", value])
5656     end
57     return conditions.join(" AND ")
57     operator = options.delete(:operator)
58     return conditions.join(" #{operator || "AND"} ")
5859   end
5960 
6061   def l_klass