fastapi 0.1.3 → 0.1.4
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 +4 -4
- data/lib/fastapi.rb +11 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6369f604a2afca61a671da12cbee46b0a77a0bd
|
4
|
+
data.tar.gz: 5d2eaddb04a7b769ba7c62485f5d77f83ecec75c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02f3c5f7681ffcc9adbf4351566af0b9df31c9c5472dbe166889f421ccedb80212cc5c1713ab59b9f8288679cce7bf02985055bfa7447061a8e221dc65890c4b
|
7
|
+
data.tar.gz: 580b30381b56586836d8bf90def041392cec310614bf6dd1b19b52a699a924b63572b7d64200f5bdbd3dcb201f6bcc7a9d98c004ad75ec338170901d23a667e1
|
data/lib/fastapi.rb
CHANGED
@@ -142,7 +142,7 @@ class FastAPI
|
|
142
142
|
#
|
143
143
|
# @return [String] available data in JSON format
|
144
144
|
def data_json
|
145
|
-
Oj.dump(@data)
|
145
|
+
Oj.dump(@data, mode: :compat)
|
146
146
|
end
|
147
147
|
|
148
148
|
# Returns the metadata from the most recently executed `filter` or `fetch` call.
|
@@ -156,7 +156,7 @@ class FastAPI
|
|
156
156
|
#
|
157
157
|
# @return [String] available metadata in JSON format
|
158
158
|
def meta_json
|
159
|
-
Oj.dump(meta)
|
159
|
+
Oj.dump(meta, mode: :compat)
|
160
160
|
end
|
161
161
|
|
162
162
|
# Returns both the data and metadata from the most recently executed `filter` or `fetch` call.
|
@@ -173,7 +173,7 @@ class FastAPI
|
|
173
173
|
#
|
174
174
|
# @return [String] JSON data and metadata
|
175
175
|
def response
|
176
|
-
Oj.dump(self.to_hash)
|
176
|
+
Oj.dump(self.to_hash, mode: :compat)
|
177
177
|
end
|
178
178
|
|
179
179
|
# Returns a JSONified string representing a standardized empty API response, with a provided error message
|
@@ -189,13 +189,18 @@ class FastAPI
|
|
189
189
|
error: message.to_s
|
190
190
|
},
|
191
191
|
data: [],
|
192
|
-
})
|
192
|
+
}, mode: :compat)
|
193
193
|
end
|
194
194
|
|
195
195
|
private
|
196
196
|
|
197
197
|
def fastapi_query(filters = {}, safe = false)
|
198
198
|
|
199
|
+
if (not ActiveRecord::ConnectionAdapters.constants.include? :PostgreSQLAdapter or
|
200
|
+
not ActiveRecord::Base.connection.instance_of? ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
|
201
|
+
raise 'Fast API only supports PostgreSQL at this time'
|
202
|
+
end
|
203
|
+
|
199
204
|
offset = 0
|
200
205
|
count = 500
|
201
206
|
order = nil
|
@@ -681,6 +686,8 @@ class FastAPI
|
|
681
686
|
field_list = []
|
682
687
|
joins = []
|
683
688
|
|
689
|
+
# array_to_string: (ActiveRecord::Base.connection.instance_of? ActiveRecord::ConnectionAdapters::SQLite3Adapter) ? 'GROUP_CONCAT' : 'ARRAY_TO_STRING',
|
690
|
+
|
684
691
|
# Base fields
|
685
692
|
fields.each do |field|
|
686
693
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keith Horwood
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|