Sha256: ca81c33e94612419f8fdca3cd0f9c0793baef57522df2823347a318f7ef094e8

Contents?: true

Size: 768 Bytes

Versions: 3

Compression:

Stored size: 768 Bytes

Contents

require 'massive_record/orm/persistence/operations/embedded/operation_helpers'

module MassiveRecord
  module ORM
    module Persistence
      module Operations
        module Embedded
          class Update
            include Operations, OperationHelpers

            def execute
              raise_error_if_embedded_in_proxy_targets_are_missing
              update_only_embedded_record_in_owners
            end


            private

            def update_only_embedded_record_in_owners
              embedded_in_proxies.select { |p| p.load_proxy_target.present? }.each do |proxy|
                update_embedded(proxy, Base.coder.dump(record.attributes_db_raw_data_hash))
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
massive_record-0.2.2 lib/massive_record/orm/persistence/operations/embedded/update.rb
massive_record-0.2.2.rc2 lib/massive_record/orm/persistence/operations/embedded/update.rb
massive_record-0.2.2.rc1 lib/massive_record/orm/persistence/operations/embedded/update.rb