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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fastapi.rb +11 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4460407df7d3911b524f6dd308dbedbae42d0adc
4
- data.tar.gz: bda3575a0b7923296a47a545983637f0dc8858a7
3
+ metadata.gz: a6369f604a2afca61a671da12cbee46b0a77a0bd
4
+ data.tar.gz: 5d2eaddb04a7b769ba7c62485f5d77f83ecec75c
5
5
  SHA512:
6
- metadata.gz: 4f154e7c32f580077ab94fc229469c7b1d6e844733ccead5d6cd3e689b611953921243245be63ea62086e0345c3b44baeb9988922e050fcaba0cb23615e7fb89
7
- data.tar.gz: 33b875319c13e7269fa914d5773c1c23c2ed73c03fe68841ebff7be90de58dc47e419e43ff3d73b7318c5cb931765d91dffa607618ec33fc60734d3fd43883e5
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.3
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-22 00:00:00.000000000 Z
11
+ date: 2014-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj