Class: Account::MailingForm
- Inherits:
-
ApplicationForm
- Object
- ApplicationForm
- Account::MailingForm
- Defined in:
- app/forms/account/mailing_form.rb
Instance Attribute Summary
Attributes inherited from ApplicationForm
Instance Method Summary collapse
- #submit ⇒ Object
-
#update(params = {}) ⇒ Object
validates :receive_notifications, presence: true validates :attachments_via_email, presence: true validates :allowed_letter_types_ids, presence: true validate :valid_letter_types.
Methods inherited from ApplicationForm
Instance Method Details
#submit ⇒ Object
18 19 20 21 22 23 24 |
# File 'app/forms/account/mailing_form.rb', line 18 def submit return false unless valid? api_answer = TranslationCms::Api::Customers::Notification.create(attributes) merge_responce! api_answer errors.empty? end |
#update(params = {}) ⇒ Object
validates :receive_notifications, presence: true validates :attachments_via_email, presence: true validates :allowed_letter_types_ids, presence: true validate :valid_letter_types
14 15 16 |
# File 'app/forms/account/mailing_form.rb', line 14 def update(params = {}) self.attributes = params.reverse_merge(attributes) end |