Module: Labimotion::LinkedProperties

Extended by:
ActiveSupport::Concern
Included in:
Element
Defined in:
lib/labimotion/models/concerns/linked_properties.rb

Overview

Segmentable concern

Instance Method Summary collapse

Instance Method Details

#detach_properties(properties) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/labimotion/models/concerns/linked_properties.rb', line 6

def detach_properties(properties)
  return properties if Labimotion::PropertiesHandler.check_properties(properties)

  properties[Labimotion::Prop::LAYERS]&.keys&.each do |key|
    properties = Labimotion::PropertiesHandler.detach(properties, key, Labimotion::FieldType::DRAG_SAMPLE)
    properties = Labimotion::PropertiesHandler.detach(properties, key, Labimotion::FieldType::DRAG_ELEMENT)
    properties = Labimotion::PropertiesHandler.detach(properties, key, Labimotion::FieldType::UPLOAD)
    properties = Labimotion::PropertiesHandler.detach(properties, key, Labimotion::FieldType::TABLE)
  end
  properties
end