fastapi 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fastapi.rb +4 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a6369f604a2afca61a671da12cbee46b0a77a0bd
4
- data.tar.gz: 5d2eaddb04a7b769ba7c62485f5d77f83ecec75c
3
+ metadata.gz: 328f3a1e05457ead48ba2c6d01c09bfd7dcdfeb0
4
+ data.tar.gz: 40861b7243fede0344304840c81344e3c1a06db4
5
5
  SHA512:
6
- metadata.gz: 02f3c5f7681ffcc9adbf4351566af0b9df31c9c5472dbe166889f421ccedb80212cc5c1713ab59b9f8288679cce7bf02985055bfa7447061a8e221dc65890c4b
7
- data.tar.gz: 580b30381b56586836d8bf90def041392cec310614bf6dd1b19b52a699a924b63572b7d64200f5bdbd3dcb201f6bcc7a9d98c004ad75ec338170901d23a667e1
6
+ metadata.gz: 18773bd2adf7042592c600e7a00c4c0af2514d39796f20dfe195f6eb789396ed40facbf52e46b63fcebf81b7775b648773e7f0da82c9acdce2207f0e2587df9e
7
+ data.tar.gz: 7d21483a9259b0d76c78aac7d40afb0d499b4924855255b622fdd4998a20d306281956f72fa093eb57ac6beae9da76fc8a52342c23088e88a77643db4216d0ae
data/lib/fastapi.rb CHANGED
@@ -680,7 +680,7 @@ class FastAPI
680
680
  end
681
681
  end
682
682
 
683
- self_string = @model.to_s.downcase
683
+ self_string = @model.to_s.tableize.singularize
684
684
  self_string_table = @model.to_s.tableize
685
685
 
686
686
  field_list = []
@@ -737,7 +737,7 @@ class FastAPI
737
737
  # Many fields (Many to 1)
738
738
  has_many.each do |model|
739
739
 
740
- model_string = model.to_s.downcase
740
+ model_string = model.to_s.tableize.singularize
741
741
  model_string_table = model.to_s.tableize
742
742
  model_symbol = model_string_table.to_sym
743
743
 
@@ -772,7 +772,8 @@ class FastAPI
772
772
  'as',
773
773
  '__' + model_string_table,
774
774
  'WHERE',
775
- '__' + model_string_table + '.' + self_string + '_id',
775
+ '__' + model_string_table + '.' + self_string + '_id IS NOT NULL',
776
+ 'AND __' + model_string_table + '.' + self_string + '_id',
776
777
  '=',
777
778
  self_string_table + '.id',
778
779
  has_many_filters,
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
4
+ version: 0.1.5
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-23 00:00:00.000000000 Z
11
+ date: 2014-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj