Class: FeedbackMessage

Inherits:
ApplicationRecord
  • Object
show all
Includes:
Checkable, HasLanguage, HasOwner, HasTrack, HasUuid, Toggleable
Defined in:
app/models/feedback_message.rb

Overview

Message from visitor

Attributes:

agent_id [Agent], optional
attachment [SimpleFileUploader], optional
comment [text], optional
created_at [DateTime]
data [jsonb]
email [string], optional
ip_address_id [IpAddress], optional
language_id [Language], optional
name [string], optional
phone [string], optional
processed [boolean]
updated_at [DateTime]
user_id [User], optional
uuid [uuid]

Constant Summary collapse

COMMENT_LIMIT =
5000
EMAIL_LIMIT =
250
EMAIL_PATTERN =
/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z0-9][-a-z0-9]+)\z/i.freeze
NAME_LIMIT =
100
PHONE_LIMIT =
30

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HasOwner

#owned_by?, #owner_name

Class Method Details

.entity_parametersObject



56
57
58
# File 'app/models/feedback_message.rb', line 56

def self.entity_parameters
  %i[attachment comment email language_id name phone]
end

.page_for_administration(page = 1) ⇒ Object

Parameters:

  • page (Integer) (defaults to: 1)


52
53
54
# File 'app/models/feedback_message.rb', line 52

def self.page_for_administration(page = 1)
  list_for_administration.page(page)
end

Instance Method Details

#attachment_nameObject



60
61
62
63
64
# File 'app/models/feedback_message.rb', line 60

def attachment_name
  return if attachment.blank?

  File.basename(attachment.path)
end