Class: TranslationCms::Api::Customers::Notification

Inherits:
Base
  • Object
show all
Defined in:
lib/translation_cms/api/customers/notification.rb

Instance Method Summary collapse

Methods inherited from Base

all!, custom_scope!, default_attributes, destroy, dummy_resource!, #method_missing_with_translations_will_change, parsed!, path_with_custom_scope, resource_type!, update

Instance Method Details

#paramsObject

property :letter_types, type: :array property :available_letters, type: :array



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/translation_cms/api/customers/notification.rb', line 12

def params
  {
    receive_notifications: receive_notifications,
    attachments_via_email: attachments_via_email,
    letter_types_ids: letter_types_ids || [],
    available_letters: available_letters.map do |letter|
      letter.as_json(only: [:id, :title, :description, :code])
            .merge(description: letter.description, title: letter.title)
    end
  }
end