effective_events 3.3.15 → 3.4.1
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 +4 -4
- data/app/models/effective/event_registrant.rb +7 -2
- data/lib/effective_events/version.rb +1 -1
- data/lib/effective_events.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d36c39d52577f7de941d719224d2f4b6133250477dea413d9e31d8b5c6ac3b23
|
|
4
|
+
data.tar.gz: 4100baee17818a324d6e75adf8180db11133e69169d1e1c6f4b71cc36499b395
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6ac1adf4082dc46c4d2245083a671678af9c14d9088f9b1a9e0a0c2cf50d1f3f488976280c3d9ae1600e93d045d47aadf5475e79b132af7b2a9f45e3ad59f8bb
|
|
7
|
+
data.tar.gz: 4229959384d4a312218fa8868f70c6d313c9730c4cec319f5079f12ba9d1c2220c46a7d68f5ca150d20e306693609eaf0c7c2826040b29f21b8087911b3617d4
|
|
@@ -85,7 +85,7 @@ module Effective
|
|
|
85
85
|
self.owner ||= event_registration.owner
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
-
with_options(unless: -> { purchased? && !blank_registrant_was }) do
|
|
88
|
+
with_options(unless: -> { purchased? && !blank_registrant_was && !user_changed? }) do
|
|
89
89
|
before_validation(if: -> { blank_registrant? }) do
|
|
90
90
|
assign_attributes(user: nil, organization: nil, first_name: nil, last_name: nil, email: nil, company: nil)
|
|
91
91
|
end
|
|
@@ -103,6 +103,11 @@ module Effective
|
|
|
103
103
|
assign_attributes(first_name: user.first_name, last_name: user.last_name, email: (user.try(:public_email).presence || user.email))
|
|
104
104
|
end
|
|
105
105
|
|
|
106
|
+
before_validation(if: -> { user.present? && user_changed? && user.class.try(:effective_memberships_organization_user?) }) do
|
|
107
|
+
organization = user.organizations.first
|
|
108
|
+
assign_attributes(organization: organization, company: organization.to_s.presence)
|
|
109
|
+
end
|
|
110
|
+
|
|
106
111
|
before_validation(if: -> { organization.blank? && user.present? && user.class.try(:effective_memberships_organization_user?) }) do
|
|
107
112
|
assign_attributes(company: user.organizations.first.to_s.presence) if company.blank?
|
|
108
113
|
end
|
|
@@ -134,7 +139,7 @@ module Effective
|
|
|
134
139
|
|
|
135
140
|
# Validate this user isn't already registered for this event ticket on another registration
|
|
136
141
|
# Or for this event on any ticket, when one ticket per event is enabled
|
|
137
|
-
validate(if: -> { user.present? && event_ticket.present? && registrant_validations_enabled?
|
|
142
|
+
validate(if: -> { user.present? && event_ticket.present? && (registrant_validations_enabled? || (registered? && !archived? && user_changed?)) }) do
|
|
138
143
|
duplicate_of = (validate_one_ticket_per_event? ? { event: event } : { event_ticket: event_ticket })
|
|
139
144
|
|
|
140
145
|
if Effective::EventRegistrant.unarchived.registered.where(user: user).where(duplicate_of).where.not(id: id).present?
|
data/lib/effective_events.rb
CHANGED