Class: ROM::HTTP::Commands::Create
- Inherits:
-
Commands::Create
- Object
- Commands::Create
- ROM::HTTP::Commands::Create
- Defined in:
- lib/rom/http/commands/create.rb
Instance Method Summary collapse
Instance Method Details
#execute(tuples) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/rom/http/commands/create.rb', line 7 def execute(tuples) Array([tuples]).flatten.map do |tuple| attributes = input[tuple] validator.call(attributes) relation.insert(attributes.to_h) end.to_a end |