effective_organizations 0.0.4 → 0.0.5

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: 1680db25ffadd9aedde1cda52429e5b4d42ee4b2c6c2a16a801631099b7e3db6
4
- data.tar.gz: b0ba4cfb29be4714b411101f2c2a50e073a433458c69453f0f032d73b0bcbc4d
3
+ metadata.gz: 1f978ab4fee3200d82c2f9c6858f707d35155c0da70f0f4a611e558597ea17e2
4
+ data.tar.gz: 67a3e163f691e3baeec1e48ce0687fcb649e491b65e4fb9a01cd03575726b59c
5
5
  SHA512:
6
- metadata.gz: cbb3f71d72a698486a909e5c7cb418adb1862254d4d1b3868ab4be56ce6a14c4fc18e7e6f3d1c71649700a7186f3ceeb144ef7fe866f5d5a7e71fe7589bbace4
7
- data.tar.gz: 4e3bd0d65a5b370d3f8ad1284dc660720af0bc5b39165c82b265ac421d75ddab6dc1246f63aeba5aebed32f6c77298f211073671420dcbbb9abf8dac3709615a
6
+ metadata.gz: 2f07c62ddd2d61aa1f31c5abba3d5cd56b019b6fc58e474d1b063f3246416d077d357109b7c66fe9f514c1d263e18e23488662c9c2701fe52db5738ddba6ffe1
7
+ data.tar.gz: ea9ecd0a199c925c5ddd3550a83524d23fab81d48c4e91d620bee64970d7ae95238f561c8184bbeb4c43182db2e7b030e1afa97d663049c2c1b8c24b706f2a16
@@ -11,11 +11,24 @@ class EffectiveRepresentativesDatatable < Effective::Datatable
11
11
 
12
12
  col :roles, search: roles_collection
13
13
 
14
- actions_col
14
+ unless attributes[:actions] == false
15
+ actions_col
16
+ end
17
+
15
18
  end
16
19
 
17
20
  collection do
18
- Effective::Representative.deep.all.where(organization: current_user.organizations)
21
+ scope = Effective::Representative.deep.all.where(organization: current_user.organizations)
22
+
23
+ if attributes[:organization_id]
24
+ scope = scope.where(organization_id: attributes[:organization_id])
25
+ end
26
+
27
+ if attributes[:user_id]
28
+ scope = scope.where(user_id: attributes[:user_id])
29
+ end
30
+
31
+ scope
19
32
  end
20
33
 
21
34
  def roles_collection
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrganizations
2
- VERSION = '0.0.4'.freeze
2
+ VERSION = '0.0.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_organizations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-15 00:00:00.000000000 Z
11
+ date: 2021-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails