pacecar 1.1.10 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -197,6 +197,11 @@ To get the top 10 commenters...
197
197
 
198
198
  User.maximim_comments.limited(10)
199
199
 
200
+ = Supported Databases
201
+
202
+ * MySQL
203
+ * SQLite
204
+
200
205
  = License
201
206
 
202
207
  Pacecar is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
@@ -30,11 +30,11 @@ module Pacecar
30
30
  end
31
31
 
32
32
  def define_past_future_scopes(name)
33
- named_scope "#{name}_in_past", lambda {
34
- { :conditions => ["#{quoted_table_name}.#{name} <= ?", Time.now] }
33
+ named_scope "#{name}_in_past", lambda {
34
+ { :conditions => ["#{quoted_table_name}.#{name} <= ?", now] }
35
35
  }
36
36
  named_scope "#{name}_in_future", lambda {
37
- { :conditions => ["#{quoted_table_name}.#{name} >= ?", Time.now] }
37
+ { :conditions => ["#{quoted_table_name}.#{name} >= ?", now] }
38
38
  }
39
39
  end
40
40
 
@@ -59,6 +59,10 @@ module Pacecar
59
59
  }
60
60
  end
61
61
 
62
+ def now
63
+ defined?(Time.zone_default) && Time.zone_default ? Time.zone_default.now : Time.now
64
+ end
65
+
62
66
  end
63
67
  end
64
68
  end
@@ -21,7 +21,7 @@ module Pacecar
21
21
  end
22
22
  end
23
23
 
24
- def all_column_names
24
+ def safe_column_names
25
25
  safe_columns.collect(&:name)
26
26
  end
27
27
 
@@ -13,7 +13,7 @@ module Pacecar
13
13
  protected
14
14
 
15
15
  def define_search_scopes
16
- all_column_names.each do |name|
16
+ safe_column_names.each do |name|
17
17
  named_scope "#{name}_equals".to_sym, lambda { |query|
18
18
  { :conditions => ["#{quoted_table_name}.#{name} = :query", { :query => query }] }
19
19
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pacecar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.10
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Jankowski
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-13 00:00:00 -05:00
12
+ date: 2009-12-30 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15