effective_events 0.20.4 → 0.20.6

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: 0e12380e8bc5f8d3cb7c8aca29a41195601e80d5254679a416883ac4978f9ce3
4
- data.tar.gz: 2640f55717703f890452ebd971978a639bcc72a344ec05d3c67466e8aa94ab85
3
+ metadata.gz: fac59635c68fc7c14fdf1971a2a7b3cae0d2c5f2469e2c025d827b8d4c03428d
4
+ data.tar.gz: aa6ef8fa7bca306eedc5b4549c33561f08c384df90f7d57f7570f9d01b9a4919
5
5
  SHA512:
6
- metadata.gz: 80f0a6730bf416ad9b51850487a7f0702d4b3c4a0e4fa07e923163a86384ee6958d423261fc63f98cb664faccd26dfb60166d240ec3879d9c3809a9e1db07a8a
7
- data.tar.gz: 680987d30c84a812b21b11f4c50555ae2a79881f8e80023a14c53052037c2e8c4722d5f269442acbd216f9c65b0e18af514f6c3204945fbe8bbd490fd23066e6
6
+ metadata.gz: a3911304d324505f653a369436933f57190427be6555abe84c576dc2ca8adbec7687ae8b923fb68b70b901d147eaa57b40a5265c6d1f52f60331f2e268605d56
7
+ data.tar.gz: cfddf6a3d9282f1bc8b6380825d00c89c7ee486d24c193b2cefe0891846d3a5f9a821b2a8d11024c42c7a6d9eb94a8492ba8d0e6c694ad8bb31715616ec36dc0
@@ -23,7 +23,7 @@ module Effective
23
23
  return if resource.event.registerable? && !resource.event.sold_out?(except: resource)
24
24
 
25
25
  flash[:danger] = "Your selected event is no longer available for registration. This event registration is no longer available."
26
- return redirect_to('/dashboard')
26
+ return redirect_to(view_context.return_to_dashboard_path)
27
27
  end
28
28
 
29
29
  def expire_ticket_selection_window
@@ -45,7 +45,7 @@ module EffectiveEventsHelper
45
45
 
46
46
  # Allow an admin to assign archived tickets
47
47
  authorized = (namespace == :admin)
48
- member = current_user.try(:is_any?, :member)
48
+ member = current_user.try(:membership_present?)
49
49
 
50
50
  tickets = (authorized ? event.event_tickets : event.event_tickets.reject(&:archived?))
51
51
  tickets = tickets.reject { |ticket| ticket.member_only? } unless (authorized || member)
@@ -181,7 +181,7 @@ module Effective
181
181
  [
182
182
  (content_tag(:span, 'Member', class: 'badge badge-warning') if member_ticket?),
183
183
  (content_tag(:span, 'Waitlist', class: 'badge badge-warning') if waitlisted_not_promoted?),
184
- (content_tag(:span, 'Archived', class: 'badge badge-warning') if event_ticket&.archived?)
184
+ (content_tag(:span, 'Archived', class: 'badge badge-warning') if archived?)
185
185
  ].compact.join(' ').html_safe
186
186
  end
187
187
 
@@ -204,7 +204,7 @@ module Effective
204
204
  end
205
205
 
206
206
  def member_present?
207
- user.try(:is?, :member) || organization.try(:is?, :member)
207
+ user.try(:membership_present?) || organization.try(:membership_present?)
208
208
  end
209
209
 
210
210
  def member_ticket?
@@ -287,6 +287,18 @@ module Effective
287
287
  true
288
288
  end
289
289
 
290
+ def archive!
291
+ super()
292
+ orders.reject(&:purchased?).each { |order| order.update_purchasable_attributes! }
293
+ true
294
+ end
295
+
296
+ def unarchive!
297
+ super()
298
+ orders.reject(&:purchased?).each { |order| order.update_purchasable_attributes! }
299
+ true
300
+ end
301
+
290
302
  def event_ticket_price
291
303
  raise('expected an event') if event.blank?
292
304
  raise('expected an event ticket') if event_ticket.blank?
@@ -375,7 +387,7 @@ module Effective
375
387
  def assign_price
376
388
  raise('is already purchased') if purchased?
377
389
 
378
- price = waitlisted_not_promoted? ? 0 : event_ticket_price
390
+ price = (waitlisted_not_promoted? || archived?) ? 0 : event_ticket_price
379
391
 
380
392
  assign_attributes(price: price)
381
393
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  - all_member_only_tickets = tickets.all? { |ticket| ticket.member_only? }
7
7
  - any_member_only_tickets = tickets.any? { |ticket| ticket.member_only? }
8
- - is_member = current_user.try(:is?, :member)
8
+ - is_member = current_user.try(:membership_present?)
9
9
 
10
10
  - if event.early_bird?
11
11
  .alert.alert-warning.mb-3
@@ -1,3 +1,3 @@
1
1
  module EffectiveEvents
2
- VERSION = '0.20.4'.freeze
2
+ VERSION = '0.20.6'.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.4
4
+ version: 0.20.6
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-09-12 00:00:00.000000000 Z
11
+ date: 2024-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails