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



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

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