quandl_cassinatra 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
@@ -63,19 +63,15 @@ module Searchable
|
|
63
63
|
# ensure integer
|
64
64
|
value = value.to_i
|
65
65
|
# 0 is the current observation
|
66
|
-
if value
|
67
|
-
order(:desc)
|
68
|
-
limit( 1 )
|
69
|
-
# negative value implies ascending order
|
70
|
-
elsif value < 0
|
66
|
+
if value < 0
|
71
67
|
order(:asc)
|
72
|
-
offset(
|
68
|
+
offset( value * -1 )
|
73
69
|
limit( 1 )
|
74
70
|
# postive value is an offset of current observation
|
75
71
|
else
|
76
72
|
order(:desc)
|
77
|
-
offset( value
|
78
|
-
limit(1)
|
73
|
+
offset( value )
|
74
|
+
limit( 1 )
|
79
75
|
end
|
80
76
|
}
|
81
77
|
|