effective_events 0.20.1 → 0.20.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: 31dd5da1350e8c47f262ae186a59758c589747ad054bb2d9c73a766aab858673
4
- data.tar.gz: 3523f02edb4b5e1e5144c4ae43686ab077a4873f0ce5346fb27429a05853e2de
3
+ metadata.gz: '0709b951c8c62ef98e05483a64c07f02c4f324e598a38fe248e53cf46505e0e7'
4
+ data.tar.gz: cccb708e60d917e8a52ca2da3933c145db3dd316835eaab493fa4fc3d62eef70
5
5
  SHA512:
6
- metadata.gz: f5a012b7f897b93841d14080109278adc3d52231ffc9e0e5fc71c3379406d28cbf5ed6b11a3455eaeb8737b7065abc87ad78eea8b7441e16d34d886c919d00bd
7
- data.tar.gz: 1f21df543c199fbb5f0cfb565b928d4d29405c731dc24dd8824baeb5b83e3436f63966100af4cefac0a1700757737e5e52f982a4ddc9e0ea36055186e5dac1fc
6
+ metadata.gz: 6a26c1676942e725de1f158c1763a7163f119fa12873e7bec523094aba5c62a82e0327bf91df00003a74d20f8bb326246205aad0bc337fd69608852cba1dc0cd
7
+ data.tar.gz: '0882344df168c99d2a767eac559a4865e5f12f0e6c96759f7cfafa7b1f3e4c6e2d5ae9745e8ba3abf65576613f32936878ded5289fd57c88125f825431298c66'
@@ -133,10 +133,10 @@ module EffectiveEventsEventRegistration
133
133
 
134
134
  # Validate the same registrant user isn't being registered twice
135
135
  validate(if: -> { current_step == :details }) do
136
- present_event_registrants.group_by { |er| er.user }.each do |user, event_registrants|
136
+ present_event_registrants.group_by { |er| [er.user, er.event_ticket] }.each do |(user, event_ticket), event_registrants|
137
137
  if user.present? && event_registrants.length > 1
138
- errors.add(:base, "Unable to register #{user} more than once")
139
- event_registrants.each { |er| er.errors.add(:user_id, "cannot be registered more than once") }
138
+ errors.add(:base, "Unable to register #{user} for #{event_ticket} more than once")
139
+ event_registrants.each { |er| er.errors.add(:user_id, "cannot be registered for #{event_ticket} more than once") }
140
140
  end
141
141
  end
142
142
  end
@@ -316,6 +316,8 @@ module EffectiveEventsEventRegistration
316
316
  def tickets!
317
317
  assign_attributes(current_step: :tickets) # Ensure the unavailable tickets validations are run
318
318
 
319
+ reset_all_wizard_steps_after(:tickets) unless was_submitted?
320
+
319
321
  update_event_registrants
320
322
  select_event_registrants
321
323
  waitlist_event_registrants
@@ -94,8 +94,10 @@ module Effective
94
94
 
95
95
  save!
96
96
 
97
- order = Effective::Order.new(items: self, user: owner)
98
- order.purchase!(skip_buyer_validations: true, email: false)
97
+ unless registered?
98
+ order = Effective::Order.new(items: self, user: owner)
99
+ order.purchase!(skip_buyer_validations: true, email: false)
100
+ end
99
101
 
100
102
  true
101
103
  end
@@ -115,7 +115,7 @@ module Effective
115
115
  validates :email, email: true
116
116
 
117
117
  # This works for persisted and adding a new one. But not adding two at same time in a registration
118
- validates :user_id, uniqueness: { scope: [:event_id], allow_blank: true, message: 'is already registered for this event' }
118
+ validates :user_id, uniqueness: { scope: [:event_ticket_id], allow_blank: true, message: 'is already registered for this event ticket' }
119
119
 
120
120
  # First name, last name and email are always required fields on details
121
121
  validates :first_name, presence: true, if: -> { registrant_validations_enabled? }
@@ -23,4 +23,7 @@
23
23
 
24
24
  = f.check_box :archived, label: "Archive this addon. It will be displayed as archived on the owner's event registration"
25
25
 
26
- = f.submit 'Save'
26
+ - if f.object.new_record?
27
+ = f.submit 'Save and Mark Registered'
28
+ - else
29
+ = f.submit 'Save'
@@ -5,7 +5,7 @@
5
5
  - if resource.display_countdown?
6
6
  .mt-4
7
7
 
8
- = card do
9
- %p Your tickets are reserved until #{resource.selected_expires_at.strftime("%I:%M%P %Z")}
8
+ .alert.alert-warning
9
+ Your tickets are reserved until #{resource.selected_expires_at.strftime("%l:%M%P %Z")}
10
10
 
11
11
  .col-lg-9.mb-3= yield
@@ -1,3 +1,3 @@
1
1
  module EffectiveEvents
2
- VERSION = '0.20.1'.freeze
2
+ VERSION = '0.20.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.20.1
4
+ version: 0.20.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-08-26 00:00:00.000000000 Z
11
+ date: 2024-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails