Module: Errgonomic::Rails::ActiveRecordPredicateBuilder

Defined in:
lib/errgonomic/rails/active_record_optional.rb

Overview

A hash condition never reaches the quoting layer as its raw value: the predicate builder hands it to a bind attribute, which serializes it through the column type and casts an unrecognized object to nil. Unwrap one step earlier, where every hash condition passes, so a Some binds as its inner value and a None as nil, which Arel renders as IS NULL.

Instance Method Summary collapse

Instance Method Details

#build(attribute, value, *args) ⇒ Object



297
298
299
# File 'lib/errgonomic/rails/active_record_optional.rb', line 297

def build(attribute, value, *args)
  super(attribute, Errgonomic::Rails.unwrap_options(value), *args)
end