Module | Sequel::SQL::NoBooleanInputMethods |
In: |
lib/sequel/sql.rb
|
This module augments the default initalize method for the ComplexExpression subclass it is included in, so that attempting to use boolean input when initializing a NumericExpression or StringExpression results in an error. It is not expected to be used directly.
Raise an Error if one of the args would be boolean in an SQL context, otherwise call super.
# File lib/sequel/sql.rb, line 389 389: def initialize(op, *args) 390: args.each do |a| 391: case a 392: when BooleanExpression, TrueClass, FalseClass, NilClass, Hash, ::Array 393: raise(Error, "cannot apply #{op} to a boolean expression") 394: end 395: end 396: super 397: end