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:
parent
ecec50da1d
commit
7a29220c68
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue