oso-oso 0.26.2 → 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: a6c3b7525bafd5e31ba10ec8eaa04de64064bc46
4
- data.tar.gz: b5f051293c595d019fffe2335cbdd198ff1708e9
3
+ metadata.gz: 4d5e4e44704e01c32dc47f6009c01079a800806b
4
+ data.tar.gz: 61840b935d76f9724b6a1a0539b7bf892bbbb6a8
5
5
  SHA512:
6
- metadata.gz: 700e69cf67dec53d4e923b0b65ab54c853b4228966bfedc6b124959d7586660504e3302a47e022b4765456ac05733dc69536957115f38df15ff36e408384b848
7
- data.tar.gz: e3647fc86d2edcede8c1c2a3bd7cd1e8c8c410c10440b7bb9710297a24082bca29ad0dd92af121bc89cd534759fa37ef606e8672525934f5fe43de835f2a5c15
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.2)
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.2'
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.2
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-08-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