effective_committees 0.3.0 → 0.3.1

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: 90e5560a918a9f4ff1aa79337ee3efc0863404b7059fd1ee17085a287c68558f
4
- data.tar.gz: 97c1a24dd0b0ca83bdea23b39e17afac3ed9a290883c559b3f4c3a442b721053
3
+ metadata.gz: dbb31cf79d4104f80164f1aa448576bdf3dbbf8d9546ee8168aad468bb3ac323
4
+ data.tar.gz: 91c44c4d88408777dbca98d9e5c9a27df9f57a7f4edd81be4cd62b53e7a7fd35
5
5
  SHA512:
6
- metadata.gz: 108016a92cb317eee5c2dec151fd39775b95f735d128774875af34622ec070e358aa66a956f665a4a75fe039a124923fee11fc7b3a0e8e503043d092985d4ac8
7
- data.tar.gz: 5eaa0143a3994f694531e8d63338d2cbfe2a88befab855f31a2990688dfa0fe131cf294ca68eb7ee754435bff83fe5e7b893fcf822c14cc57cbe8a38f03d87d3
6
+ metadata.gz: 784777f99c05787247df597ebd89faa5b536cf66ecb426d98e2e5d8750f370af1e419d54b23311b69f570fe6879023aa22dd7823fa5f1f8eb23fa588ea147075
7
+ data.tar.gz: dae5f13349c215669f55f1ee65479370235f9dc29a16a2df63b23a0e2028d85f5710d489baf74b0616f202bf8e6c80b8e8926f71b842da3e54091af2d171753f
@@ -20,6 +20,14 @@ module EffectiveCommitteesUser
20
20
  class_name: 'Effective::CommitteeMember', inverse_of: :user, dependent: :delete_all
21
21
 
22
22
  accepts_nested_attributes_for :committee_members, allow_destroy: true
23
+
24
+ scope :with_committee, -> (committees) {
25
+ committees = Resource.new(Effective::Committee).search_any(committees) if committees.kind_of?(String)
26
+ raise('expected an Effective::Committee') unless committees.present? && Array(committees).all? { |c| c.kind_of?(Effective::Committee) }
27
+
28
+ committee_members = Effective::CommitteeMember.where(committee: committees).where(user_type: name)
29
+ where(id: committee_members.select(:user_id))
30
+ }
23
31
  end
24
32
 
25
33
  # Instance Methods
@@ -1,3 +1,3 @@
1
1
  module EffectiveCommittees
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.3.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_committees
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
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: 2023-08-24 00:00:00.000000000 Z
11
+ date: 2023-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails