Method: ArDocStore::EmbeddableModel::InstanceMethods#mark_embeds_as_persisted

Defined in:
lib/ar_doc_store/embeddable_model.rb

#mark_embeds_as_persistedObject



55
56
57
58
59
60
61
# File 'lib/ar_doc_store/embeddable_model.rb', line 55

def mark_embeds_as_persisted
  json_attributes.values.each do |value|
    if value.respond_to?(:embedded?) && value.embedded? && respond_to?(value.attribute) && !public_send(value.attribute).nil?
      public_send(value.attribute).persist
    end
  end
end