baseapi 0.1.13 → 0.1.14

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a6f8c5e16034693c92e956e421277975f060297c
4
- data.tar.gz: 6ecded08bc1d03c2f3b434e4d7d688b6a43c0aad
3
+ metadata.gz: d1ac2404b4884ee42c68800050820c341feafe49
4
+ data.tar.gz: b8930c62ce6d395b5ac38bdd9548494cce2f4fc1
5
5
  SHA512:
6
- metadata.gz: eaee6b87986d514a069f07c5f15a1b42b0d3df9e4fc3865069cea4268319566df49dd107893af8be047dbc117659e92231c5bede60311d6cd4d9b67d86edfe18
7
- data.tar.gz: d1702cfa15dc126229ac95b00b9b7bf07c0bc03c81b48da1d206cf16006c2bab78707d4eda25e04903262686f5430e5684d45755233c72c207202f0ffebc6df2
6
+ metadata.gz: 7a852691317a1f3ce4f9aad6a18b99d4de5197ce168d39dd0546a9ce2e60b1da354db4f583a0c5b5c7380aaa84934bba5f7161dc443db81b34b0b1f41287a82b
7
+ data.tar.gz: e739f489132ae7893998034657b0b902e2f30a84bc80849d2ea1a73fba141c69d09b90d28e2cabd02ff89a2724abf1588af4f1bcd60f92c43ea657bf25cbc2cc
data/README.md CHANGED
@@ -161,10 +161,18 @@ Specify it more 20~ (v0.1.12~)
161
161
 
162
162
  GET /users.json?age=>=20
163
163
 
164
+ Specify the excess (v0.1.14~)
165
+
166
+ GET /users.json?age=>20
167
+
164
168
  Specify it less ~20 (v0.1.12~)
165
169
 
166
170
  GET /users.json?age=<=20
167
171
 
172
+ Specify the less than (v0.1.14~)
173
+
174
+ GET /users.json?age=<20
175
+
168
176
  Specify between 2015/09/01 ~ 2015/09/31 (v0.1.12~)
169
177
 
170
178
  GET /users.json?created_at[]=>=20150901&created_at[]=<=20150931
@@ -128,11 +128,13 @@ module ActiveRecordBaseExtension extend ActiveSupport::Concern
128
128
  # @return String operator
129
129
  def getOperator(value, default = '=')
130
130
  operator = default
131
- value = value.sub('!', '')
131
+ value.slice!(0) if value[0] == '!'
132
132
  if ['NULL', 'EMPTY'].include?(value.upcase)
133
133
  operator = 'IS'
134
134
  elsif value.length >= 2 and ['<=', '>='].include?(value[0..1])
135
135
  operator = value[0..1]
136
+ elsif ['<', '>'].include?(value[0])
137
+ operator = value[0]
136
138
  end
137
139
  operator
138
140
  end
@@ -152,7 +154,9 @@ module ActiveRecordBaseExtension extend ActiveSupport::Concern
152
154
  operator = prefix == 'NOT' ? 'AND' : 'OR'
153
155
  value = "NULL #{operator} #{prefix} #{column} = ''"
154
156
  elsif value.length >= 2 and ['<=', '>='].include?(value[0..1])
155
- value = value.sub('<=', '').sub('>=', '')
157
+ value = value.sub(value[0..1], '')
158
+ elsif ['<', '>'].include?(value[0])
159
+ value = value.sub(value[0], '')
156
160
  else
157
161
  value = getNaturalValue(value)
158
162
  wraps.each do |wrap|
@@ -1,3 +1,3 @@
1
1
  module Baseapi
2
- VERSION = "0.1.13"
2
+ VERSION = "0.1.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baseapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moriyuki Arakawa