effective_events 0.10.1 → 0.10.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e0eded3c712c018bb91f9c90eebe522030fa7d02d5d73b9de4001bda7c5dbcf
|
4
|
+
data.tar.gz: 3dc20c280ef92ebc93dad4cfe57df506e6a283bd4433a4792f07a236b3fb5ebc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43fcaa469c42cf91dcb5ac3f6c52509372a4d8983c91cac727d350f4c9a3a797f04d4cd1f4ee6793502a5eb868dbc1c660e51862b3a0ad299f1ad416a69c7220
|
7
|
+
data.tar.gz: e7fe84b88841792c065bd307a80656ab4248b60306c2cfecaeb007ba09aa3b2bc782ee13512a91640e02c5b39156bb923bcd6683e889d51b36f99b2bd349bc67
|
@@ -1,12 +1,13 @@
|
|
1
1
|
module Effective
|
2
2
|
class EventRegistrationsController < ApplicationController
|
3
|
-
|
4
3
|
if defined?(Devise)
|
5
4
|
before_action :authenticate_user!, unless: -> { action_name == 'new' || (action_name == 'show' && params[:id] == 'start') }
|
6
5
|
end
|
7
6
|
|
8
7
|
include Effective::WizardController
|
9
8
|
|
9
|
+
before_action :redirect_unless_registerable, only: [:new, :show]
|
10
|
+
|
10
11
|
resource_scope -> {
|
11
12
|
event = Effective::Event.find(params[:event_id])
|
12
13
|
EffectiveEvents.EventRegistration.deep.where(owner: current_user, event: event)
|
@@ -26,5 +27,16 @@ module Effective
|
|
26
27
|
resource.ready!
|
27
28
|
end
|
28
29
|
|
30
|
+
# If the event is no longer registerable, do not let them continue
|
31
|
+
def redirect_unless_registerable
|
32
|
+
return if resource.blank?
|
33
|
+
return if resource.event.blank?
|
34
|
+
return if resource.event.registerable?
|
35
|
+
return if resource.submitted?
|
36
|
+
|
37
|
+
flash[:danger] = "Your selected event is no longer available for registration. This event registration is no longer available."
|
38
|
+
return redirect_to('/dashboard')
|
39
|
+
end
|
40
|
+
|
29
41
|
end
|
30
42
|
end
|
@@ -77,7 +77,13 @@ module EffectiveEventsEventRegistration
|
|
77
77
|
timestamps
|
78
78
|
end
|
79
79
|
|
80
|
-
scope :deep, -> {
|
80
|
+
scope :deep, -> {
|
81
|
+
includes(:owner)
|
82
|
+
.includes(event: [:rich_texts, event_products: :purchased_event_addons, event_tickets: :purchased_event_registrants])
|
83
|
+
.includes(event_registrants: [event_ticket: :purchased_event_registrants])
|
84
|
+
.includes(event_addons: [event_product: :purchased_event_addons])
|
85
|
+
}
|
86
|
+
|
81
87
|
scope :sorted, -> { order(:id) }
|
82
88
|
|
83
89
|
scope :in_progress, -> { where.not(status: [:submitted]) }
|
@@ -1,5 +1,5 @@
|
|
1
1
|
-# In progress registration
|
2
|
-
- registration = EffectiveEvents.EventRegistration.in_progress.for(current_user).first
|
2
|
+
- registration = EffectiveEvents.EventRegistration.in_progress.includes(event: :event_products).for(current_user).first
|
3
3
|
|
4
4
|
- datatable = EffectiveResources.best('EffectiveEventRegistrationsDatatable').new(self, namespace: :effective)
|
5
5
|
|
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.10.
|
4
|
+
version: 0.10.2
|
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-12-
|
11
|
+
date: 2023-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|