Skip to content

Instantly share code, notes, and snippets.

@ajuckel
Created September 14, 2011 18:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ajuckel/1217329 to your computer and use it in GitHub Desktop.
ARJDBC #105 Monkeypatch
module Arel
module Visitors
class DepthFirst < Arel::Visitors::Visitor
def initialize block = nil
@block = block || Proc.new
if defined?(JRUBY_VERSION)
require 'java'
if @block.to_java.block.arity.nil?
@block = lambda { |c| nil }
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment