GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: bringing da chronic to your rails models
Homepage: http://b.logi.cx/2008/2/8/gettin-less-icky-with-the-chronic
Clone URL: git://github.com/flogic/autochronic.git
Making natural-language datetime spec pass without making the other three 
datetime specs fail. WIN.
ymendel (author)
Thu Feb 07 21:54:50 -0800 2008
commit  e172c16715489b0c8761af21f8bd288a89c7c6e8
tree    2aa73b05992bcacf08f95f2bfb5bc3ade8519ee4
parent  b989468a12fd21ab34430f19d93aad1dccbe5082
...
10
11
12
 
 
 
 
 
 
 
 
13
14
...
10
11
12
13
14
15
16
17
18
19
20
21
22
0
@@ -10,5 +10,13 @@ class ActiveRecord::ConnectionAdapters::Column
0
       parsed = Chronic.parse(string)
0
       parsed and parsed.to_date
0
     end
0
+
0
+ def string_to_time_with_chronic(string)
0
+ result = string_to_time_without_chronic(string)
0
+ return result if result
0
+
0
+ Chronic.parse(string)
0
+ end
0
+ alias_method_chain :string_to_time, :chronic
0
   end
0
 end

Comments

    No one has commented yet.