mirror of
https://github.com/lloeki/rebel.git
synced 2025-12-06 01:54:40 +01:00
Map (binary) logic operators to AND and OR
This commit is contained in:
parent
9c4c031db9
commit
000e7f2ae2
2 changed files with 13 additions and 0 deletions
|
|
@ -105,10 +105,12 @@ module Rebel::SQL
|
|||
def and(*clause)
|
||||
Raw.new("#{self.parens?} AND #{Rebel::SQL.and_clause(*clause)}")
|
||||
end
|
||||
alias & and
|
||||
|
||||
def or(*clause)
|
||||
Raw.new("#{self} OR #{Rebel::SQL.and_clause(*clause)}").wants_parens!
|
||||
end
|
||||
alias | or
|
||||
|
||||
def eq(n)
|
||||
case n
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue