sam / do fork watch download tarball
public
Rubygem
Description: DataObjects
Homepage: http://rubyforge.org/projects/dorb
Clone URL: git://github.com/sam/do.git
Search Repo:
added support for ranges in query, like Model.all(:date => 
yesterday..tomorrow)
somebee (author)
Wed May 07 13:44:27 -0700 2008
commit  ae575ab38ddcd7454ad344c7fc1bf4f790cf18b2
tree    01b911701cd52b85701fd84c56f7bcc4e97177f8
parent  069209c8bce372338ca37ea3c0c3437972f9705f
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-do_sqlite3
0
+data_objects
0
 =================
0
 
0
 A plugin for the Merb framework that provides ....
...
43
44
45
 
46
47
48
...
87
88
89
 
 
 
 
90
91
92
...
43
44
45
46
47
48
49
...
88
89
90
91
92
93
94
95
96
97
0
@@ -43,6 +43,7 @@
0
         when Date then quote_date(value)
0
         when TrueClass, FalseClass then quote_boolean(value)
0
         when Array then quote_array(value)
0
+ when Range then quote_range(value)
0
         when Symbol then quote_symbol(value)
0
         else
0
           if value.respond_to?(:to_sql)
0
@@ -87,6 +88,10 @@
0
     
0
     def quote_array(value)
0
       "(#{value.map { |entry| quote_value(entry) }.join(', ')})"
0
+ end
0
+
0
+ def quote_range(value)
0
+ "#{quote_value(value.first)} AND #{quote_value(value.last)}"
0
     end
0
   end
0
   

Comments

    No one has commented yet.