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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52711c835dc479a8bc52e2c523d295999270b98eac479cfa8af855d12452466e
4
- data.tar.gz: d5368da347ce46759fc6858b4c231788f91a0baf4ba70a8a8c9104c10e991c1d
3
+ metadata.gz: 60e4351c09c9d070ea622ed6e7770df2f14d53e177a4ea74e04294d00b91af6f
4
+ data.tar.gz: 65436fdfda6a93aa08e1846d44b13131eedcc9d92e5831742dd6892d5ed87a32
5
5
  SHA512:
6
- metadata.gz: 7a62bf9547cd039f6f9035c0e075328db83455173709a0dbd672db63be2a6c92cf10551d43962deddcafca76c828c53ff0df2cf374ebf26a8e960d443b71586b
7
- data.tar.gz: 7d57abebdaffccdf19af9a1220e20cd244054f04e8807da1e2dc3a45bb40a6010758e4e8676ded2e6321f14d59e4ca488dd05ac391514403c0315464b21c5c86
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
@@ -25,6 +25,8 @@ module Effective
25
25
  scope :deep, -> { includes(:owner) }
26
26
  scope :sorted, -> { order(:start_on) }
27
27
 
28
+ scope :removed, -> { where(removed: true) }
29
+
28
30
  validates :owner, presence: true
29
31
 
30
32
  # validates :categories, presence: true, unless: -> { removed? }
@@ -1 +1,5 @@
1
+ .card
2
+ .card-body= render 'effective/fee_payments/summary', fee_payment: fee_payment
3
+
1
4
  = render 'effective/fee_payments/fee_payment', fee_payment: fee_payment
5
+ = render 'effective/fee_payments/orders', fee_payment: fee_payment
@@ -3,9 +3,8 @@
3
3
  = f.hidden_field :owner_id
4
4
  = f.hidden_field :owner_type
5
5
  - else
6
- - raise('todo')
7
- - collection = EffectiveMembershipsOwner.descendants.map { |d| [d.name.to_s, d.members.sorted] }.to_h
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}
@@ -1,4 +1,4 @@
1
1
  - if fee_payment.submit_order&.purchased?
2
2
  .card.mb-4
3
3
  .card-body
4
- = render(fee_payment.submit_order)
4
+ = render('effective/orders/order', order: fee_payment.submit_order)
@@ -1,3 +1,3 @@
1
1
  module EffectiveMemberships
2
- VERSION = '0.4.8'
2
+ VERSION = '0.4.9'
3
3
  end
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.8
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