effective_events 0.2.2 → 0.2.3
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: adf3a913271740485085f4e12ae04f6754a13d5d083dd6f36e9e2593758e3fcc
|
|
4
|
+
data.tar.gz: 7d0b73f2c8719a17df4e3d13e92b530621be01ec1f7571d04970fd15f844cbda
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0b0b3d00b86109a754208c65df7e9ff9d172cc6ed4d0cc004181e69f1b7b2baf8ba2c80473e7909414a6a96b10ebe3438799f2d516a8e1c0768241685f40680a
|
|
7
|
+
data.tar.gz: 3eba654d48fcf0e1b4f14e44d1b85d5806e89ba959c3f592f4da22a32ef34a66861f4b991372e637becd5f4d7857846e1da819483823d6473e6ecba2245f91be
|
|
@@ -9,38 +9,5 @@ module Effective
|
|
|
9
9
|
EffectiveEvents.EventRegistration.deep.where(owner: current_user, event: event)
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
# Allow only 1 in-progress event registration at a time
|
|
13
|
-
before_action(only: [:new, :show], unless: -> { resource&.done? }) do
|
|
14
|
-
existing = resource_scope.in_progress.where.not(id: resource).first
|
|
15
|
-
|
|
16
|
-
if existing.present?
|
|
17
|
-
flash[:success] = "You have been redirected to your existing in progress event registration"
|
|
18
|
-
redirect_to effective_events.event_event_registration_build_path(existing.event, existing, existing.next_step)
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
after_save do
|
|
23
|
-
flash.now[:success] = ''
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
# The default redirect doesn't respect nested resources here
|
|
27
|
-
def new
|
|
28
|
-
self.resource ||= (find_wizard_resource || resource_scope.new)
|
|
29
|
-
EffectiveResources.authorize!(self, :new, resource)
|
|
30
|
-
|
|
31
|
-
redirect_to effective_events.event_event_registration_build_path(
|
|
32
|
-
resource.event,
|
|
33
|
-
(resource.to_param || :new),
|
|
34
|
-
(resource.first_uncompleted_step || resource_wizard_steps.first)
|
|
35
|
-
)
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
private
|
|
39
|
-
|
|
40
|
-
def permitted_params
|
|
41
|
-
model = (params.key?(:effective_event_registration) ? :effective_event_registration : :event_registration)
|
|
42
|
-
params.require(model).permit!.except(:status, :status_steps, :wizard_steps, :submitted_at)
|
|
43
|
-
end
|
|
44
|
-
|
|
45
12
|
end
|
|
46
13
|
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.2.
|
|
4
|
+
version: 0.2.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: 2022-01-
|
|
11
|
+
date: 2022-01-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|