Skip to content

Commit

Permalink
Add patch for rails/arel#499
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraichen committed Sep 20, 2017
1 parent 9768124 commit 356adfa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/patch/all.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

require 'patch/active_record/queue'
require 'patch/active_record/connection_pool'

require 'patch/active_record/interval_style'

require 'patch/arel/bind_params'
15 changes: 15 additions & 0 deletions lib/patch/arel/bind_params.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module Patch
# https://github.com/rails/arel/pull/499
module BindParam
# rubocop:disable MethodName
def visit_Arel_SelectManager(o, collector)
collector << '('
visit(o.ast, collector) << ')'
end
# rubocop:enable all
end

::Arel::Visitors::ToSql.prepend BindParam
end

0 comments on commit 356adfa

Please sign in to comment.