effective_events 0.9.3 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82816ca9bcbe094f896c1ed69dc9ed52e73eeb96e496c8a92b53f3b17478b183
4
- data.tar.gz: a508d7f01b1a9dda0d79ba93690b129444e3acf6c1feddf1a3b0de7ad8e043fc
3
+ metadata.gz: d470360f476ba5b09c2f4acd803fa110b24f2897d93786f7590c57fa6cdb7456
4
+ data.tar.gz: cd7f329fa1a2eb7408eadff743089caa9bb35dd0bd9a2d133df826dd7632354c
5
5
  SHA512:
6
- metadata.gz: bad7ad39adc838a4e65ec253261472dcae6bc4d646821e450e3d2b3023d608847a158952bbfde0b1368604fb5fb761f277cec1c608718788b591c7bdb0034de0
7
- data.tar.gz: b9479522e0ef4962da64ed39ca391a23b18cf4fe1c0d8ceb2d3084d8d8c7fb7bd04c5ae68ba8cf08411fda0feed2664040fee86876315deed7a7c597bb75bc94
6
+ metadata.gz: 0c75dc24831325d021992b156f74efaea4f19d296080d3d9468745c80a099c4cacdc8a1dab03d938b68c917533f455930ce9f70b65d53a16dbb0e0e324decdbf
7
+ data.tar.gz: f57f397116d450ff4646e908843a1f3c155a94563eafe3a7c7956b662abb42c1a761c5cb545584fd1440527796c282990a4693825029337b8c0ac15c82527778
@@ -56,6 +56,13 @@ module EffectiveEventsEventRegistration
56
56
  has_many :orders, -> { order(:id) }, as: :parent, class_name: 'Effective::Order', dependent: :nullify
57
57
  accepts_nested_attributes_for :orders
58
58
 
59
+ # Effective Namespace
60
+ # For coupon fees
61
+ if defined?(EffectiveMemberships)
62
+ has_many :fees, -> { order(:id) }, as: :parent, class_name: 'Effective::Fee', dependent: :nullify
63
+ accepts_nested_attributes_for :fees, reject_if: :all_blank, allow_destroy: true
64
+ end
65
+
59
66
  effective_resource do
60
67
  # Acts as Statused
61
68
  status :string, permitted: false
@@ -112,7 +119,13 @@ module EffectiveEventsEventRegistration
112
119
 
113
120
  # All Fees and Orders
114
121
  def submit_fees
115
- (event_registrants + event_addons)
122
+ if owner.respond_to?(:outstanding_coupon_fees) # effective_memberships_owner
123
+ # Order item price reduction handled by reduce_order_item_coupon_fee_price in acts_as_purchasable_wizard
124
+ Array(owner.outstanding_coupon_fees).each { |fee| fees << fee unless fees.include?(fee) }
125
+ (event_registrants + event_addons + fees)
126
+ else
127
+ (event_registrants + event_addons)
128
+ end
116
129
  end
117
130
 
118
131
  def after_submit_purchased!
@@ -1,3 +1,3 @@
1
1
  module EffectiveEvents
2
- VERSION = '0.9.3'.freeze
2
+ VERSION = '0.10.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_events
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.10.0
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-11-21 00:00:00.000000000 Z
11
+ date: 2023-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails