norr-couchrest 0.30.1 → 0.30.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/couchrest.rb +2 -1
- data/lib/couchrest/mixins/properties.rb +3 -1
- metadata +1 -1
data/lib/couchrest.rb
CHANGED
|
@@ -16,7 +16,8 @@ require 'rubygems'
|
|
|
16
16
|
begin
|
|
17
17
|
require 'json'
|
|
18
18
|
rescue LoadError
|
|
19
|
-
|
|
19
|
+
#this is not a good test as the yajl lib works fine...
|
|
20
|
+
#raise "You need install and require your own json compatible library since couchrest rest couldn't load the json/json_pure gem" unless Kernel.const_defined?("JSON")
|
|
20
21
|
end
|
|
21
22
|
require 'rest_client'
|
|
22
23
|
|
|
@@ -74,7 +74,9 @@ module CouchRest
|
|
|
74
74
|
# Auto parse Time objects
|
|
75
75
|
self[property.name] = if ((property.init_method == 'new') && target == 'Time')
|
|
76
76
|
# Using custom time parsing method because Ruby's default method is toooo slow
|
|
77
|
-
self[key].is_a?(String) ? Time.mktime_with_offset(self[key].dup) : self[key]
|
|
77
|
+
#self[key].is_a?(String) ? Time.mktime_with_offset(self[key].dup) : self[key]
|
|
78
|
+
# lets use something that is slow - that works :)
|
|
79
|
+
self[key].is_a?(String) ? Time.parse(self[key].dup) : self[key]
|
|
78
80
|
else
|
|
79
81
|
# Let people use :send as a Time parse arg
|
|
80
82
|
klass = ::CouchRest.constantize(target)
|