Method: Hash#sql_expr
- Defined in:
- lib/sequel/extensions/core_extensions.rb
#sql_expr ⇒ Object
Return a Sequel::SQL::BooleanExpression created from this hash, matching all of the conditions. Rarely do you need to call this explicitly, as Sequel generally assumes that hashes specify this type of condition.
{:a=>true}.sql_expr # SQL: a IS TRUE
{:a=>1, :b=>[2, 3]}.sql_expr # SQL: a = 1 AND b IN (2, 3)
146 147 148 |
# File 'lib/sequel/extensions/core_extensions.rb', line 146 def sql_expr ::Sequel::SQL::BooleanExpression.from_value_pairs(self) end |