lib/roda/endpoints/transactions.rb in roda-endpoints-0.2.0 vs lib/roda/endpoints/transactions.rb in roda-endpoints-0.3.0
- old
+ new
@@ -46,11 +46,13 @@
def_delegators :endpoint, :operation_for, :validation_for
# @param [Symbol] shortcut
# @param [Proc] block
def define(shortcut, &block)
+ key = key_for(shortcut)
+ return if container.key? key
container.register(
- key_for(shortcut),
+ key,
Dry.Transaction(
container: container,
endpoint: endpoint,
&block
)