Class: EventParticipant

Inherits:
ApplicationRecord show all
Includes:
Toggleable
Defined in:
app/models/event_participant.rb

Constant Summary collapse

PER_PAGE =
20
NAME_LIMIT =
100
EMAIL_LIMIT =
250
PHONE_LIMIT =
50
COMMENT_LIMIT =
10000
NOTICE_LIMIT =
250
COMPANY_LIMIT =
250
METRIC_CREATED =
'events.participants.created.hit'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.creation_parametersObject



45
46
47
# File 'app/models/event_participant.rb', line 45

def self.creation_parameters
  entity_parameters - %i(notice) + %i(event_id)
end

.entity_parametersObject



41
42
43
# File 'app/models/event_participant.rb', line 41

def self.entity_parameters
  %i(name surname email phone comment notice company)
end

.page_for_administration(page = 1, filter = {}) ⇒ Object

Parameters:

  • page (Integer) (defaults to: 1)
  • filter (Hash) (defaults to: {})


37
38
39
# File 'app/models/event_participant.rb', line 37

def self.page_for_administration(page = 1, filter = {})
  filtered(filter).recent.page(page).per(PER_PAGE)
end

Instance Method Details

#full_nameObject



49
50
51
# File 'app/models/event_participant.rb', line 49

def full_name
  "#{surname} #{name}".strip
end