Permalink
Browse files

Move Time duck punch to a separate file

  • Loading branch information...
1 parent 631765f commit a58cb2693b1488d67496c9bb016881e19803d7cb @topfunky committed Sep 13, 2008
Showing with 15 additions and 15 deletions.
  1. +1 −0 app/models/basic_model.rb
  2. +0 −15 config/environment.rb
  3. +14 −0 lib/duck_punches/time.rb
@@ -1,4 +1,5 @@
require 'couchrest'
+require 'duck_punches/time'
##
# A minimal class to help use CouchDB and CouchRest with Rails.
View
@@ -71,18 +71,3 @@
require 'json/add/rails'
ENV['TZ'] = 'UTC'
-
-class Time
- def to_json(*a)
- {
- 'json_class' => self.class.name,
- 'data' => self.strftime("%Y/%m/%d %H:%M:%S %z")
- }.to_json(*a)
- end
-end
-
-class Time
- def self.json_create(o)
- parse(*o['data'])
- end
-end
View
@@ -0,0 +1,14 @@
+class Time
+ def to_json(*a)
+ {
+ 'json_class' => self.class.name,
+ 'data' => self.strftime("%Y/%m/%d %H:%M:%S %z")
+ }.to_json(*a)
+ end
+end
+
+class Time
+ def self.json_create(o)
+ parse(*o['data'])
+ end
+end

0 comments on commit a58cb26

Please sign in to comment.