-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
In an empty db, 1 Video is created
2.1.0 :010 > float_created_at = Video.first.created_at.to_f
1406102520.972
2.1.0 :012 > Video.where(:created_at.gte => float_created_at).count
1
2.1.0 :011 > Video.where(:created_at.gt => float_created_at).count
1
$gt should be 0, not 1
This is important for example when using timestamps for pagination, where millisecond precision is necessary (ie. multiple Posts might have been created on the same second).
Similarly $lte , in the following case should return 1, not 0
2.1.0 :014 > Video.where(:created_at.lt => float_created_at).count
0
2.1.0 :015 > Video.where(:created_at.lte => float_created_at).count
0