effective_events 0.6.0 → 0.6.2

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: a72f25c5582cd504f0c3c486d18cbf4980271f83c42a1f4fb859e0cfdbdeee05
4
- data.tar.gz: 3ffa275a580807a9c15bc8b7b7f5af4700121e915dff3aa4d960347fdf0f6f64
3
+ metadata.gz: '03792a86651968a66d776678245154a7e1315bd4927a5f6803cf822831b11b54'
4
+ data.tar.gz: fff7d1415683e67b7982fd82bfdfa0f258e10451ea1645f00ce2b7a86fd86abd
5
5
  SHA512:
6
- metadata.gz: ac9451988420547d6fe212bce3d5134592da7e3fcdcf743e1a39df985a3f0e1011c15d5e3218cdcb7fd71ccd21eb4f2da5c1419cde8b40970223e99bd55c957c
7
- data.tar.gz: c01e5b8b9772649b9de54acc04313d243845297aa11055619b6c27890fef430be91ac15740b601006701a94c760484cea975d8607716c78db2245d3e0e9b7f5d
6
+ metadata.gz: a760d7c086e811c0bd6f64f36e2bcddefd725c86c533f922448f8242f0c60edade3dbe7c3f96b07b034200d19f99efd3cd161b1de460eed9e24ba26965f569ba
7
+ data.tar.gz: 7157dfd23817e90be3102d6ce494b027f392b94568557dccf85b99c0622150e33311db116d256f3a9996e7fff8fea4d2fb6d9c08bd5eb9438ee00b889de9b18e
@@ -117,7 +117,6 @@ module Effective
117
117
 
118
118
  validates :registration_start_at, presence: true, unless: -> { external_registration? }
119
119
  validates :registration_end_at, presence: true, unless: -> { external_registration? }
120
- validates :external_registration_url, presence: true, if: -> { external_registration? }
121
120
 
122
121
  validate(if: -> { start_at && end_at }) do
123
122
  self.errors.add(:end_at, 'must be after start date') unless start_at < end_at
@@ -167,7 +166,7 @@ module Effective
167
166
  return false if closed?
168
167
  return false if sold_out?
169
168
 
170
- external_registration? || event_tickets.present?
169
+ (external_registration? && external_registration_url.present?) || event_tickets.present?
171
170
  end
172
171
 
173
172
  def closed?
@@ -50,9 +50,11 @@ module Effective
50
50
  self.price ||= event_product.price
51
51
  end
52
52
 
53
- validates :first_name, presence: true
54
- validates :last_name, presence: true
55
- validates :email, email: true
53
+ with_options(if: -> { new_record? }) do
54
+ validates :first_name, presence: true
55
+ validates :last_name, presence: true
56
+ validates :email, presence: true, email: true
57
+ end
56
58
 
57
59
  def to_s
58
60
  persisted? ? title : 'addon'
@@ -6,10 +6,10 @@
6
6
  = f.select :event_product_id, effective_events_event_products_collection(event), label: 'Add-on'
7
7
 
8
8
  .row
9
- .col-lg= f.text_field :first_name
10
- .col-lg= f.text_field :last_name
9
+ .col-lg= f.text_field :first_name, required: true
10
+ .col-lg= f.text_field :last_name, required: true
11
11
 
12
12
  .row
13
- .col-lg= f.email_field :email
13
+ .col-lg= f.email_field :email, required: true
14
14
 
15
15
  -# = f.text_area :notes, label: 'Notes'
@@ -1,3 +1,3 @@
1
1
  module EffectiveEvents
2
- VERSION = '0.6.0'.freeze
2
+ VERSION = '0.6.2'.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.6.0
4
+ version: 0.6.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-02-24 00:00:00.000000000 Z
11
+ date: 2023-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails