Class: MessageDraft
- Inherits:
-
Message
- Object
- Common::Base
- Message
- MessageDraft
- Defined in:
- app/models/message_draft.rb
Overview
drafts are essentially messages with an implied folder (drafts), and if a reply, an implied message
Models Message draft
Constant Summary
Constants inherited from Message
Message::MAX_SINGLE_FILE_SIZE_MB, Message::MAX_TOTAL_FILE_SIZE_MB
Instance Attribute Summary collapse
- #has_message ⇒ Boolean
-
#original_attributes ⇒ Object
Returns the value of attribute original_attributes.
Attributes inherited from Message
#attachment, #attachments, #body, #category, #id, #proxy_sender_name, #read_receipt, #recipient_id, #recipient_name, #sender_id, #sender_name, #sent_date, #subject, #triage_group_name
Attributes inherited from Common::Base
Instance Method Summary collapse
- #check_as_draft ⇒ Object private
- #check_as_replydraft ⇒ Object private
- #message? ⇒ Boolean
Methods inherited from Message
#<=>, #as_reply, #each_upload_size_validation, #initialize, #reply?, #total_upload_size, #total_upload_size_validation
Methods inherited from Common::Base
#changed, #changed?, #changes, default_sort, filterable_attributes, #initialize, max_per_page, per_page, sortable_attributes
Constructor Details
This class inherits a constructor from Message
Instance Attribute Details
#has_message ⇒ Boolean
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'app/models/message_draft.rb', line 10 class MessageDraft < Message validate :check_as_replydraft, if: proc { reply? } validate :check_as_draft, unless: proc { reply? } attr_accessor :original_attributes attribute :has_message, Boolean def end private def check_as_replydraft errors.add(:base, 'This draft requires a reply-to message.') unless end def check_as_draft errors.add(:base, 'This draft cannot have a reply-to message') if end end |
#original_attributes ⇒ Object
Returns the value of attribute original_attributes.
13 14 15 |
# File 'app/models/message_draft.rb', line 13 def original_attributes @original_attributes end |
Instance Method Details
#check_as_draft ⇒ Object (private)
27 28 29 |
# File 'app/models/message_draft.rb', line 27 def check_as_draft errors.add(:base, 'This draft cannot have a reply-to message') if end |
#check_as_replydraft ⇒ Object (private)
23 24 25 |
# File 'app/models/message_draft.rb', line 23 def check_as_replydraft errors.add(:base, 'This draft requires a reply-to message.') unless end |
#message? ⇒ Boolean
17 18 19 |
# File 'app/models/message_draft.rb', line 17 def end |