dm-persevere-adapter 0.39.0 → 0.40.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/persevere_adapter.rb +4 -3
- data/spec/persevere_adapter_spec.rb +4 -4
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.40.0
|
data/lib/persevere_adapter.rb
CHANGED
@@ -360,7 +360,7 @@ module DataMapper
|
|
360
360
|
|
361
361
|
tblname = query.model.storage_name
|
362
362
|
path = "/#{tblname}/#{json_query}"
|
363
|
-
|
363
|
+
puts path
|
364
364
|
response = @persevere.retrieve(path, headers)
|
365
365
|
|
366
366
|
if response.code.match(/20?/)
|
@@ -638,8 +638,9 @@ module DataMapper
|
|
638
638
|
when DataMapper::Query::Conditions::InclusionComparison then process_in(condition.subject.name, condition.value)
|
639
639
|
when DataMapper::Query::Conditions::EqualToComparison then
|
640
640
|
cond = condition.loaded_value
|
641
|
-
cond = 'undefined' if
|
642
|
-
cond = "\"#{
|
641
|
+
cond = 'undefined' if cond.nil?
|
642
|
+
cond = "\"#{cond}\"" if cond.is_a?(String)
|
643
|
+
cond = "date(%10.f)" % (Time.parse(cond.to_s).to_f * 1000) if cond.is_a?(DateTime)
|
643
644
|
"#{condition.subject.name.to_s}=#{cond}"
|
644
645
|
when DataMapper::Query::Conditions::NullOperation then []
|
645
646
|
when Array then
|
@@ -240,10 +240,10 @@ describe DataMapper::Adapters::PersevereAdapter do
|
|
240
240
|
end
|
241
241
|
|
242
242
|
it "should find by DateTime" do
|
243
|
-
|
244
|
-
|
245
|
-
debugger
|
246
|
-
Bozon.all(:created_at =>
|
243
|
+
time = Time.now
|
244
|
+
b = Bozon.create(:title => "To Search with Date Time", :author => 'Bloo Reguard', :created_at => time)
|
245
|
+
# debugger
|
246
|
+
Bozon.all(:created_at => time).length.should eql(1)
|
247
247
|
end
|
248
248
|
|
249
249
|
after(:all) do
|