Permalink
Fetching contributors…
Cannot retrieve contributors at this time
28 lines (24 sloc) 504 Bytes
require 'rom/sql/commands/error_wrapper'
module ROM
module SQL
module Commands
# SQL delete command
#
# @api public
class Delete < ROM::Commands::Delete
adapter :sql
include ErrorWrapper
# Deletes tuples from a relation
#
# @return [Array<Hash>] deleted tuples
#
# @api public
def execute
deleted = relation.to_a
relation.delete
deleted
end
end
end
end
end