validates_with_block (DataMapper::Validate::ValidatesWithBlock)

    # File lib/dm-validations/validators/block_validator.rb, line 46
          def validates_with_block(*fields, &block)
            @__validates_with_block_count ||= 0
            @__validates_with_block_count += 1
            # create method and pass it to MethodValidator
            raise ArgumentError.new('You need to pass a block to validates_with_block method') unless block_given?
            method_name = "__validates_with_block_#{@__validates_with_block_count}".to_sym
            define_method(method_name, block)
            opts = opts_from_validator_args(fields)
            opts[:method] = method_name
            add_validator_to_context(opts, fields.empty? ? [method_name] : fields, DataMapper::Validate::MethodValidator)
          end