effective_memberships 0.4.17 → 0.4.18

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: 1394fcdd25d9322f467e1392a9efeec60cc028e424ee85d3baa464d4d185a46a
4
- data.tar.gz: 6c4660193bb2e98b113a4ba1e7372b469dcda714f2d78d712b635a497b488d3c
3
+ metadata.gz: 51b551fdd6f2f1148fcca4d2d34a8745c14e359210634508ae26939d4a4563ec
4
+ data.tar.gz: 85fff32681fd9c9e64e1010df663fb2ec7aeb5f95e2b9a95aeb7e944aad370c2
5
5
  SHA512:
6
- metadata.gz: 4f4bd2c3f2f544a65d9bbace898fc5538ec115175a635d2895e399597d1687850b8cbf4824bf28517c9b8cd96bee3c96fdd03fcf6224efe39db03650a85881c8
7
- data.tar.gz: 9dd8b11979d28592083378f98ab4d69a3c452f156c0698e3eb717273321d4aefe20069accfe00272afc945e0791fffc202fcf3cec526b008922339a5b334f9fb
6
+ metadata.gz: 9e8c76e43c5e006162ffdc8c13274f3a6f70046a52bafac971487161f6720ba3ea056235c271d1e41778d2ec93cbc9feb4ca07e89486fd5f97a36e57f6308abc
7
+ data.tar.gz: 6cbadbdab149dd6f473fede0536c5f79710cd354cf229fc24f30ae3dbc0ae3706167eb45374e6839fd4e578da45944389c885fb279238dbd9d326872a9677d55
@@ -53,6 +53,15 @@ module EffectiveMembershipsOwner
53
53
  where(id: with_paid_fees_through.select(:owner_id))
54
54
  }
55
55
 
56
+ scope :members_with_category, -> (categories) {
57
+ raise('expected an EffectiveMemberships.Category') unless Array(categories).all? { |cat| cat.kind_of?(EffectiveMemberships.Category) }
58
+
59
+ membership_categories = Effective::MembershipCategory.where(category: categories)
60
+ memberships = Effective::Membership.where(id: membership_categories.select(:membership_id))
61
+
62
+ where(id: memberships.where(owner_type: name).select(:owner_id))
63
+ }
64
+
56
65
  end
57
66
 
58
67
  def assign_member_role
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.4.17'
2
+ VERSION = '0.4.18'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_memberships
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.17
4
+ version: 0.4.18
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: 2022-07-08 00:00:00.000000000 Z
11
+ date: 2022-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails