Class: LeanCms::FormSubmission
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- LeanCms::FormSubmission
- Defined in:
- app/models/lean_cms/form_submission.rb
Instance Method Summary collapse
-
#form_data ⇒ Object
Get all form data as hash.
-
#mark_as_read! ⇒ Object
Mark as read.
-
#mark_as_replied! ⇒ Object
Mark as replied.
-
#unread? ⇒ Boolean
Check if unread.
Instance Method Details
#form_data ⇒ Object
Get all form data as hash
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'app/models/lean_cms/form_submission.rb', line 27 def form_data { name: name, email: email, phone: phone, company_name: company_name, city: city, state: state, zip: zip, message: }.merge(additional_data || {}) end |
#mark_as_read! ⇒ Object
Mark as read
17 18 19 |
# File 'app/models/lean_cms/form_submission.rb', line 17 def mark_as_read! update(status: :read) end |
#mark_as_replied! ⇒ Object
Mark as replied
22 23 24 |
# File 'app/models/lean_cms/form_submission.rb', line 22 def mark_as_replied! update(status: :replied) end |
#unread? ⇒ Boolean
Check if unread
41 42 43 |
# File 'app/models/lean_cms/form_submission.rb', line 41 def unread? status == 'new_submission' end |