Class: ROM::HTTP::Commands::Update

Inherits:
Commands::Update
  • Object
show all
Defined in:
lib/rom/http/commands/update.rb

Overview

HTTP update command

Instance Method Summary collapse

Instance Method Details

#assert_tuple_countObject


20
21
22
# File 'lib/rom/http/commands/update.rb', line 20

def assert_tuple_count
  # noop
end

#execute(tuples) ⇒ Object

Submits each of the provided tuples via HTTP put


13
14
15
16
17
18
# File 'lib/rom/http/commands/update.rb', line 13

def execute(tuples)
  Array([tuples]).flatten.map do |tuple|
    attributes = input[tuple]
    relation.update(attributes.to_h)
  end.to_a
end