Class: ROM::HTTP::Commands::Create

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

Overview

HTTP Create command

@api public

Instance Method Summary collapse

Instance Method Details

#execute(tuples) ⇒ Object

Submits each of the provided tuples over HTTP post


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

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