Class: NetworkManager::PostAttachmentHandler

Inherits:
NetworkManager show all
Defined in:
app/services/network_manager/post_attachment_handler.rb

Overview

Synchronizing post attachments with central site

Constant Summary

Constants inherited from NetworkManager

MAIN_HOST

Instance Attribute Summary

Attributes inherited from NetworkManager

#data, #entity

Class Method Summary collapse

Methods inherited from NetworkManager

ignored_attributes, permitted_attributes

Class Method Details

.relationship_data(entity) ⇒ Object

Parameters:

  • entity (PostAttachment)


6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/services/network_manager/post_attachment_handler.rb', line 6

def self.relationship_data(entity)
  {
    id: entity.id,
    type: entity.class.table_name,
    attributes: {
      name: entity.name
    },
    meta: {
      file_path: entity.file.path
    }
  }
end