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



22
23
24
# File 'lib/rom/http/commands/update.rb', line 22

def assert_tuple_count
  # noop
end

#execute(tuples) ⇒ Object

Submits each of the provided tuples via HTTP put



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

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