effective_events 0.11.1 → 0.11.3

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: 908edb48306e3813893671ea9ba33cc3d1988258a47451edecfeee86197136a7
4
- data.tar.gz: 7bb18df7c58fd2fa7e08b17710a1b5eefe22574690f1532243aab1e559cc44ec
3
+ metadata.gz: 12812ed11c2f839cd66a8efd68bd2fe954285ef3ada26fa169082d2c97279359
4
+ data.tar.gz: ce5e83f092b9373ea720cb03e7524aecae7093a9561a831c68f2088cb7a4a332
5
5
  SHA512:
6
- metadata.gz: 5f9e45f483664485e43509d46bb0209a7567bd66b5bf27f425cfbe03ee6a3b0f171362db99d6faf7c2070074be3210239d59140f0989260c2b1fd18aa5b820ca
7
- data.tar.gz: ac11a1ab1e15d1e58f5ab7e6db346906fcf6836caedbb6c45f94fbf57c177334b379da57ae8e91658b23d017fb8d62f790f740c82c0d2c2ab55662edcba6084d
6
+ metadata.gz: 3840af3be1d4ded9d04dccbf66fbee23f196aa251dfcc68d76f6cedd5534f2dfea6e19b8d4da1e3c00e4eae94633e4a2ca09a8ccc1ed4b459e3cbf607b9ebf8a
7
+ data.tar.gz: d8ab4acd7c5bf18b5a17bc2098bcaca247457ea2705cff91b9da1a2b5f3257f1c392d1d57db6ea1b0436301ec2c2a15811a3004c1953fd5d13d63429bfe29c42
@@ -124,23 +124,19 @@ module EffectiveEventsEventRegistration
124
124
  event&.event_products.present? ? wizard_step_keys : (wizard_step_keys - [:addons])
125
125
  end
126
126
 
127
+ def find_or_build_submit_fees
128
+ with_outstanding_coupon_fees(submit_fees)
129
+ end
130
+
127
131
  # All Fees and Orders
128
132
  def submit_fees
129
- if owner.respond_to?(:outstanding_coupon_fees) # effective_memberships_owner
133
+ if defined?(EffectiveMemberships)
130
134
  (event_registrants + event_addons + fees)
131
135
  else
132
136
  (event_registrants + event_addons)
133
137
  end
134
138
  end
135
139
 
136
- def apply_outstanding_coupon_fees
137
- return unless owner.respond_to?(:outstanding_coupon_fees)
138
-
139
- Array(owner.outstanding_coupon_fees).each { |fee| fees << fee unless fees.include?(fee) }
140
-
141
- fees.select { |fee| fee.try(:coupon_fee?) }
142
- end
143
-
144
140
  def after_submit_purchased!
145
141
  notifications = event.event_notifications.select(&:registrant_purchased?)
146
142
  notifications.each { |notification| notification.notify!(event_registrants: event_registrants) }
@@ -50,7 +50,7 @@ module Effective
50
50
  end
51
51
 
52
52
  before_validation(if: -> { event_product.present? }) do
53
- self.price ||= event_product.price
53
+ assign_attributes(price: event_product.price) unless purchased?
54
54
  end
55
55
 
56
56
  with_options(if: -> { new_record? }) do
@@ -53,7 +53,7 @@ module Effective
53
53
  end
54
54
 
55
55
  before_validation(if: -> { event_ticket.present? }) do
56
- self.price ||= event_ticket.price
56
+ assign_attributes(price: event_ticket.price) unless purchased?
57
57
  end
58
58
 
59
59
  def to_s
@@ -0,0 +1,16 @@
1
+ .card.mb-4
2
+ .card-body
3
+ - if f.object.purchased?
4
+ = f.static_field :event_product, label: 'Purchased event add-ons'
5
+ - else
6
+ - # Admin form includes archived event products
7
+ = f.select :event_product_id, effective_events_event_products_collection(event, :admin), label: 'Add-on'
8
+
9
+ .row
10
+ .col-lg= f.text_field :first_name, required: true
11
+ .col-lg= f.text_field :last_name, required: true
12
+
13
+ .row
14
+ .col-lg= f.email_field :email, required: true
15
+
16
+ = f.text_area :notes, label: 'Notes'
@@ -11,7 +11,7 @@
11
11
  - else
12
12
  = f.static_field :owner
13
13
 
14
- = render 'effective/event_addons/fields', f: f, event: event_addon.event
14
+ = render 'admin/event_addons/fields', f: f, event: event_addon.event
15
15
 
16
16
  = f.check_box :archived, label: "Archive this addon. It will be displayed as archived on the owner's event registration"
17
17
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveEvents
2
- VERSION = '0.11.1'.freeze
2
+ VERSION = '0.11.3'.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.11.1
4
+ version: 0.11.3
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: 2024-02-02 00:00:00.000000000 Z
11
+ date: 2024-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -253,6 +253,7 @@ files:
253
253
  - app/models/effective/event_registration.rb
254
254
  - app/models/effective/event_search.rb
255
255
  - app/models/effective/event_ticket.rb
256
+ - app/views/admin/event_addons/_fields.html.haml
256
257
  - app/views/admin/event_addons/_form.html.haml
257
258
  - app/views/admin/event_notifications/_form.html.haml
258
259
  - app/views/admin/event_notifications/_form_event_registrant_purchased.html.haml