klastera 1.2.2 → 1.2.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
  SHA256:
3
- metadata.gz: 5ca95ff5ffe21289a12131f7090036072103e196af1d81f9110c7896d705f837
4
- data.tar.gz: c026cb690ec0fdbad89237a64e837b74e5112c50b4339dc78e3bdce03dfd84d5
3
+ metadata.gz: f1d1b4ee48b85521c4f7b9b085877a8138ac3f267b275cd09974102d1c55e488
4
+ data.tar.gz: ff0bd6762b86cc3aa0bcf0f97302322175f2dca25797f7f4a413cd8b0a32f01c
5
5
  SHA512:
6
- metadata.gz: 1f71455ad531a02b1f46672644f8d77aa98a4c842121de8fa1539e26920690d103e997a22470ea5dfa0efdbce6a970a89a824324343b87d90546aa4ad3653e5b
7
- data.tar.gz: 1d5962c2c598cc389c67306fcd8bbf10ca7577c07bc89795daf98d774537bac01ddcdbd366c2478a4cfc0ea3b3b9082dd1c20edcf0e58e481d7461b92c71c372
6
+ metadata.gz: e3c25e15d17ce5a8f3a3ac621efff40ee0056794dea067c5db85b19b2ecca87badae22632f0d2358ddff397bcabdd1e0f1fe54a1795f9f6fc0a1806fc9a6d88d
7
+ data.tar.gz: b0f03f444cc382dea3f8988e015eb88635b4b707344896a2f07063b0d1a996d5f939c37fed19a08bb3b9a4eee3c6e3a2aeb3b7ad75e264c156d795fc3845d03a
@@ -1,4 +1,4 @@
1
- <% if cluster_organization.is_in_cluster_mode? %>
1
+ <% if cluster_organization.is_in_cluster_mode? && cluster_user.can_admin_clusters? %>
2
2
  <div class="col-xs-12">
3
3
  <% if hide_title||=false %>
4
4
  <div class="form-group file required <%=f.object.class.name.parameterize%>_cluster_entity<%=' has-error' if f.object.errors.has_key?(:cluster_entities)%>">
@@ -103,12 +103,12 @@ module Klastera
103
103
  if organization.required_suborganization_mode?
104
104
  scope_klass = scope_klass.joins(:cluster_entities).where( cluster_entities: { cluster_id: cluster_ids } )
105
105
  else
106
+ or_these_cluster_ids = cluster_ids.present? ? " OR cluster_entities.cluster_id IN (#{cluster_ids.join(",")})" : ""
106
107
  scope_klass = scope_klass.joins("
107
108
  LEFT OUTER JOIN cluster_entities
108
- ON cluster_entities.cluster_id IN (#{cluster_ids.join(",")})
109
- AND entity_id = #{scope.table_name}.id
109
+ ON entity_id = #{scope.table_name}.id
110
110
  AND entity_type = '#{scope}'
111
- ")
111
+ ").where("cluster_entities.id IS NULL#{or_these_cluster_ids}")
112
112
  end
113
113
  # Provisional fix to avoid SQL clashes due to DISTINCT ON clause
114
114
  scope_klass = scope_class(scope).where(organization_id: organization).where(id: scope_klass.map(&:id))
@@ -1,3 +1,3 @@
1
1
  module Klastera
2
- VERSION = "1.2.2"
3
- end
2
+ VERSION = "1.2.3"
3
+ end
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.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gino Barahona