quandl_cassinatra 0.0.11 → 0.0.12

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.
@@ -62,14 +62,19 @@ module Searchable
62
62
  search_scope :row, ->(value){
63
63
  # ensure integer
64
64
  value = value.to_i
65
+ # 0 is the current observation
66
+ if value == 0
67
+ order(:desc)
68
+ limit( 1 )
65
69
  # negative value implies ascending order
66
- if value < 0
70
+ elsif value < 0
67
71
  order(:asc)
68
72
  offset( ( value * -1 ) - 1 )
69
73
  limit( 1 )
74
+ # postive value is an offset of current observation
70
75
  else
71
76
  order(:desc)
72
- offset( value )
77
+ offset( value - 1 )
73
78
  limit(1)
74
79
  end
75
80
  }
@@ -1,5 +1,5 @@
1
1
  module Quandl
2
2
  module Cassinatra
3
- VERSION = '0.0.11'
3
+ VERSION = '0.0.12'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quandl_cassinatra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: