1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Adjust BindParam as needed for AR

We need `value` to have a writer for `StatementCache` to work when
prepared statements are disabled. This is something I'd like to revert
eventually, either by disabling that form of caching in that case or
re-introducing something like the old `Bind` collector.

The addition of `nil?` is to make `IS NULL` be inserted correctly,
similar to what we already do with quoted and casted nodes
This commit is contained in:
Sean Griffin 2017-07-24 08:04:56 -04:00
parent ecec50da1d
commit 7a29220c68

View file

@ -2,7 +2,7 @@
module Arel
module Nodes
class BindParam < Node
attr_reader :value
attr_accessor :value
def initialize(value)
@value = value
@ -13,6 +13,10 @@ module Arel
other.is_a?(BindParam) &&
value == other.value
end
def nil?
value.nil?
end
end
end
end