oso-oso 0.26.1 → 0.26.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf0c10b0c91583c11a50068bb59f33c7c44146c1
4
- data.tar.gz: c115ab372e3b70dc4dfa36ad7c2466fe4129aaf7
3
+ metadata.gz: 4d5e4e44704e01c32dc47f6009c01079a800806b
4
+ data.tar.gz: 61840b935d76f9724b6a1a0539b7bf892bbbb6a8
5
5
  SHA512:
6
- metadata.gz: 3baf118cf112eb427e2b369bbd064eca8e239a4f6c5a864ec13b81615160845d68c7db7d4bb40df4e35e771b4a30022e3fe34681263e6c53972eedebb95a6c7e
7
- data.tar.gz: 16ea938c4230e2c6942831d263ebf9b0016fba9265a8a098aec557c2d2ba052aa5133c3eb3bc084d27f3375bc6777ba1cd5e7f0b788f9874bc11c671e3caf6e7
6
+ metadata.gz: 6482e63369a4afef61a87dae22534b884e9740b225b2c711bf836deaec96b201bac4a357c8a09229482409d8c0a16a29009c64b0a385d20add2c03499987e1b2
7
+ data.tar.gz: 984481b3655633994cbbf27ad13622833ce867d10cfedc62b44f3abc250f595bdd9ca02ebb978056d4f564297794927ba61311d448c59e2f4b35e13cf7b8cf98
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oso-oso (0.26.1)
4
+ oso-oso (0.26.3)
5
5
  ffi (~> 1.0)
6
6
 
7
7
  GEM
Binary file
Binary file
Binary file
@@ -10,8 +10,9 @@ module Oso
10
10
  types = filter.types
11
11
  query = filter.relations.reduce(filter.model.all) do |q, rel|
12
12
  rec = types[rel.left].fields[rel.name]
13
+ join_type = rec.kind == 'one' ? 'LEFT' : 'INNER'
13
14
  q.joins(
14
- "INNER JOIN #{rel.right.table_name} ON " \
15
+ "#{join_type} JOIN #{rel.right.table_name} ON " \
15
16
  "#{rel.left.table_name}.#{rec.my_field} = " \
16
17
  "#{rel.right.table_name}.#{rec.other_field}"
17
18
  )
@@ -263,9 +263,9 @@ module Oso
263
263
  res = host.adapter.execute_query host.adapter.build_query(filter)
264
264
 
265
265
  if rel.kind == 'one'
266
- raise "multiple parents: #{res}" unless res.length == 1
266
+ raise "multiple parents: #{res}" if res.length > 1
267
267
 
268
- res = res[0]
268
+ res = res[0] if res.length == 1
269
269
  end
270
270
 
271
271
  call_result(host.to_polar(res), call_id: call_id)
data/lib/oso/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Oso
4
- VERSION = '0.26.1'
4
+ VERSION = '0.26.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oso-oso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.1
4
+ version: 0.26.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oso Security, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-05 00:00:00.000000000 Z
11
+ date: 2022-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi