# File lib/dm-transactions.rb, line 204 def method_missing(method, *args, &block) first_arg = args.first return super unless args.size == 1 && first_arg.kind_of?(Adapters::AbstractAdapter) return super unless match = method.to_s.match(/\A(.*)_(if|unless)_(none|begin|rollback|commit)\z/) action, condition, expected_state = match.captures return super unless respond_to?(action, true) state = state_for(first_arg).to_s execute = (condition == 'if') == (state == expected_state) send(action, first_arg) if execute end