Module: EffectiveEvents

Includes:
EffectiveGem
Defined in:
lib/effective_events.rb,
lib/effective_events/engine.rb,
lib/effective_events/version.rb,
lib/generators/effective_events/install_generator.rb

Defined Under Namespace

Modules: Generators Classes: Engine

Constant Summary collapse

VERSION =
'3.2.10'.freeze

Class Method Summary collapse

Class Method Details

.categoriesObject



29
30
31
# File 'lib/effective_events.rb', line 29

def self.categories
  Array(config[:categories]) - [nil, false, '']
end

.code_of_conduct_effective_pageObject



42
43
44
45
# File 'lib/effective_events.rb', line 42

def self.code_of_conduct_effective_page
  return unless defined?(Effective::Page)
  Effective::Page.where(slug: code_of_conduct_slug).first
end

.code_of_conduct_effective_page!Object



47
48
49
50
51
52
# File 'lib/effective_events.rb', line 47

def self.code_of_conduct_effective_page!
  page = code_of_conduct_effective_page()
  raise("The Effective::Page for slug \"#{code_of_conduct_slug}\" does not exist. Please create it.") if page.blank?

  page
end

.code_of_conduct_enabled?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/effective_events.rb', line 38

def self.code_of_conduct_enabled?
  code_of_conduct_enabled == true
end

.config_keysObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/effective_events.rb', line 7

def self.config_keys
  [
    :events_table_name, :event_registrants_table_name, :event_tickets_table_name, :event_ticket_selections_table_name,
    :event_registrations_table_name, :event_products_table_name, :event_addons_table_name, :event_notifications_table_name,
    :mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_admin, :mailer_subject,
    :layout, :per_page, :use_effective_roles, :categories, :events_hint_text,
    :organization_enabled, :create_users, :company_or_organization_required, :validate_one_ticket_per_event,
    :code_of_conduct_enabled, :code_of_conduct_slug,
    :event_registration_class_name
  ]
end

.delayed?Boolean

If we can create delayed payment events at all

Returns:

  • (Boolean)


59
60
61
# File 'lib/effective_events.rb', line 59

def self.delayed?
  !!EffectiveOrders.try(:delayed?) 
end

.EventRegistrationObject



21
22
23
# File 'lib/effective_events.rb', line 21

def self.EventRegistration
  event_registration_class_name&.constantize || Effective::EventRegistration
end

.mailer_classObject



25
26
27
# File 'lib/effective_events.rb', line 25

def self.mailer_class
  mailer&.constantize || Effective::EventsMailer
end

.organization_enabled?Boolean

Returns:

  • (Boolean)


33
34
35
36
# File 'lib/effective_events.rb', line 33

def self.organization_enabled?
  raise('missing the effective_memberships gem') if organization_enabled && !defined?(EffectiveMemberships)
  organization_enabled == true
end

.validate_one_ticket_per_event?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/effective_events.rb', line 54

def self.validate_one_ticket_per_event?
  validate_one_ticket_per_event == true
end