klastera 1.1.1 → 1.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 568f218d96580bb10036134ae396871cf9db198f6d905ccc97edf835330572ba
4
- data.tar.gz: 74ea879bcd781b13a0beb7513c56c008037860479aee43c0342df8375ab38a3d
3
+ metadata.gz: a198ff3af2a7b61a6a111ba1531bb1e5075cd7ff32a74a6db06b0b27a9a450cb
4
+ data.tar.gz: 4b7548d0a282a24f72bb96ddd51b9339240f1752d9ca3b9be6d84682546c00ad
5
5
  SHA512:
6
- metadata.gz: c2220db1e8c1e4aad4b6b7f05150bb24d833cde5a234ba6c1246ae38f3135db1f7b9b5f7085a0251758e2347d90bbdd013a8fd754ddb4a50289059677b1efe1d
7
- data.tar.gz: 8eb5679f6cb3e2c96c682f17a9826cac713d9fe6550e158df88d1a2113f1896dc2c2140b273f8040eaef158d0e4c2bd25ba16a84b5e0f34a39485aec4333f6fc
6
+ metadata.gz: a37bd5892c61181db82859cbb32aa0801e4521b2a5a56cb2f561462b675ae2152916208fc786cee8e18c4141755982a0004cde10751303d5b9bdd41bc632a76a
7
+ data.tar.gz: cf022a0d10ab1903c527c22efa485993e58f18dee5f1f98cd285a86132baecb6006459659c1c6b3446678dbcbf7bc866a492114daf04423699fcf18f130f2649
@@ -32,6 +32,10 @@ module Klastera::Concerns::Organization
32
32
  def optional_filter_mode?
33
33
  cluster_mode == ::Cluster::MODES.third
34
34
  end
35
+
36
+ def optional_mode?
37
+ optional_suborganization_mode? || optional_filter_mode?
38
+ end
35
39
  end
36
40
 
37
41
  module ClassMethods
@@ -1,4 +1,4 @@
1
- <% if @user.try(:need_cluster_assignation?) %>
1
+ <% if @user.try(:is_a_cluster_user?) %>
2
2
  <div class="panel panel-default">
3
3
  <div class="panel-heading">
4
4
  <h4 class="panel-title">
@@ -1,3 +1,3 @@
1
1
  module Klastera
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
data/lib/klastera.rb CHANGED
@@ -38,9 +38,10 @@ module Klastera
38
38
  def session_clusters(user,organization)
39
39
  clusters = []
40
40
  if organization.is_in_cluster_mode?
41
- unless user.can_admin_clusters?
42
- # TODO: return a Cluster::ActiveRecord_Relation and then remove to_a in ::Cluster.of line
43
- clusters = ::ClusterUser.of(user,organization).map{|cu|::Cluster.find(cu.cluster_id)} # TODO: fix call to ::Cluster instead of Klastera::Cluster
41
+ unless user.can_admin_clusters? || organization.optional_mode?
42
+ # TODO: 1: return a Cluster::ActiveRecord_Relation and then remove to_a in ::Cluster.of line
43
+ # TODO: 2: fix call to ::Cluster instead of Klastera::Cluster
44
+ clusters = ::ClusterUser.of(user,organization).map{|cu|::Cluster.find(cu.cluster_id)}
44
45
  else
45
46
  # TODO: remove "to_a" after ClusterUser.of result became a Cluster::ActiveRecord_Relation object
46
47
  clusters = ::Cluster.of(organization).to_a
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klastera
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gino Barahona