klastera 1.1.3 → 1.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/klastera.rb +5 -7
- data/lib/klastera/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bd206c969548ea6d299cb57564aa67e9f7b88a5ba753ad5d0c112b7670ad4f0
|
4
|
+
data.tar.gz: 62580be564273b2a461808c9edbe2e9ef6c1cefa88f8b813ec9d2d02441a0836
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5f9073b9968cab43d2a88be5d1bcb9ac4cb6254670b480ac2adeadbe9c00bef78cd35a022f52626c75157844f9ad428c26afaab33b73b55e51b1bcfd0f0c682
|
7
|
+
data.tar.gz: 900d61f55072bfc19110dc4efda73c996dd7ec57e327165279e2c15b5eb86352c1f1aa98a28130b2b1f87a7d753a7891b388badee4a7771e6249fd758b662f5e
|
data/lib/klastera.rb
CHANGED
@@ -15,17 +15,15 @@ module Klastera
|
|
15
15
|
|
16
16
|
session_clusters(user,organization) do |clusters|
|
17
17
|
clusters = clusters.reject{|c|c.id.blank?}
|
18
|
-
with_clusters = nil; without_clusters = nil
|
19
18
|
|
20
|
-
if organization.required_suborganization_mode?
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
if organization.optional_mode?
|
19
|
+
if organization.required_suborganization_mode?
|
20
|
+
scope_klass = scope_klass.where("#{scope.table_name}.cluster_id IN (?)",clusters)
|
21
|
+
elsif organization.optional_mode?
|
22
|
+
with_clusters = clusters.present? ? "#{scope.table_name}.cluster_id IN (#{clusters.map(&:id).join(',')})" : nil
|
25
23
|
without_clusters = "#{with_clusters.blank? ? '' : ' OR ' }#{scope.table_name}.cluster_id IS NULL"
|
24
|
+
scope_klass = scope_klass.where("#{with_clusters}#{without_clusters}")
|
26
25
|
end
|
27
26
|
|
28
|
-
scope_klass = scope_klass.where("#{with_clusters}#{without_clusters}")
|
29
27
|
end
|
30
28
|
|
31
29
|
scope_klass
|
data/lib/klastera/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: klastera
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gino Barahona
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|