effective_memberships 0.4.8 → 0.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concerns/effective_memberships_organization.rb +5 -0
- data/app/models/concerns/effective_memberships_owner.rb +16 -0
- data/app/models/concerns/effective_memberships_user.rb +5 -0
- data/app/models/effective/membership_history.rb +2 -0
- data/app/views/admin/fee_payments/_fee_payment.html.haml +4 -0
- data/app/views/admin/fees/_form.html.haml +2 -3
- data/app/views/admin/users/_col.html.haml +12 -0
- data/app/views/effective/fee_payments/_orders.html.haml +1 -1
- data/lib/effective_memberships/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60e4351c09c9d070ea622ed6e7770df2f14d53e177a4ea74e04294d00b91af6f
|
4
|
+
data.tar.gz: 65436fdfda6a93aa08e1846d44b13131eedcc9d92e5831742dd6892d5ed87a32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bffdf6c0614f8f36ee84b38426b1a8ea9aae37a7b1385fe9ce746584196bb043d2c835f1414942f8dc504b53090e6725649657fe348feab736a9b00453aa13c7
|
7
|
+
data.tar.gz: 845130d67ea3500c634f2f9c96684af9ca1785dc50133ac94efda8087cb80e2e50bf05ea071540106d7d0250c557a0267ead9ed5b3ea2f98ca59cb99858b197a
|
@@ -62,6 +62,11 @@ module EffectiveMembershipsOrganization
|
|
62
62
|
scope :deep, -> { includes(:representatives) }
|
63
63
|
scope :sorted, -> { order(:title) }
|
64
64
|
|
65
|
+
scope :membership_applying, -> {
|
66
|
+
applicants = EffectiveMemberships.Applicant.all
|
67
|
+
without_role(:member).where(id: applicants.select(:organization_id))
|
68
|
+
}
|
69
|
+
|
65
70
|
validates :title, presence: true, uniqueness: true
|
66
71
|
validates :email, presence: true
|
67
72
|
end
|
@@ -37,6 +37,22 @@ module EffectiveMembershipsOwner
|
|
37
37
|
accepts_nested_attributes_for :membership_histories
|
38
38
|
|
39
39
|
scope :members, -> { joins(:membership) }
|
40
|
+
|
41
|
+
scope :membership_removed, -> {
|
42
|
+
removed = Effective::MembershipHistory.removed.where(owner_type: name)
|
43
|
+
without_role(:member).where(id: removed.select(:owner_id))
|
44
|
+
}
|
45
|
+
|
46
|
+
scope :membership_bad_standing, -> {
|
47
|
+
bad_standing = Effective::Membership.where(bad_standing: true).where(owner_type: name)
|
48
|
+
where(id: bad_standing.select(:owner_id))
|
49
|
+
}
|
50
|
+
|
51
|
+
scope :membership_renewed_this_period, -> {
|
52
|
+
with_paid_fees_through = Effective::Membership.with_paid_fees_through.where(owner_type: name)
|
53
|
+
where(id: with_paid_fees_through.select(:owner_id))
|
54
|
+
}
|
55
|
+
|
40
56
|
end
|
41
57
|
|
42
58
|
def assign_member_role
|
@@ -27,6 +27,11 @@ module EffectiveMembershipsUser
|
|
27
27
|
class_name: 'Effective::Representative', inverse_of: :user, dependent: :delete_all
|
28
28
|
|
29
29
|
accepts_nested_attributes_for :representatives, allow_destroy: true
|
30
|
+
|
31
|
+
scope :membership_applying, -> {
|
32
|
+
applicants = EffectiveMemberships.Applicant.all
|
33
|
+
without_role(:member).where(id: applicants.select(:user_id))
|
34
|
+
}
|
30
35
|
end
|
31
36
|
|
32
37
|
# Instance Methods
|
@@ -3,9 +3,8 @@
|
|
3
3
|
= f.hidden_field :owner_id
|
4
4
|
= f.hidden_field :owner_type
|
5
5
|
- else
|
6
|
-
-
|
7
|
-
|
8
|
-
= f.select :owner_id, collection, polymorphic: true
|
6
|
+
- collection = { 'Users' => current_user.class.sorted, 'Organizations' => EffectiveMemberships.Organization.sorted }
|
7
|
+
= f.select :owner, collection, polymorphic: true
|
9
8
|
|
10
9
|
- if f.object.new_record?
|
11
10
|
= f.select :fee_type, EffectiveMemberships.custom_fee_types
|
@@ -0,0 +1,12 @@
|
|
1
|
+
- user = (resource.respond_to?(:email) ? resource : resource.user)
|
2
|
+
|
3
|
+
= user.to_s
|
4
|
+
|
5
|
+
- if user.email.present?
|
6
|
+
%br
|
7
|
+
= mail_to user.email
|
8
|
+
|
9
|
+
- if user.membership.present?
|
10
|
+
%br
|
11
|
+
= '#' + user.membership.number
|
12
|
+
#{user.membership.categories.to_sentence}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_memberships
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
@@ -366,6 +366,7 @@ files:
|
|
366
366
|
- app/views/admin/registrar_actions/_form_remove.html.haml
|
367
367
|
- app/views/admin/representatives/_form.html.haml
|
368
368
|
- app/views/admin/representatives/_user_fields.html.haml
|
369
|
+
- app/views/admin/users/_col.html.haml
|
369
370
|
- app/views/effective/applicant_references/_applicant_reference.html.haml
|
370
371
|
- app/views/effective/applicant_references/_datatable_actions.html.haml
|
371
372
|
- app/views/effective/applicant_references/_form.html.haml
|