Skip to content

Instantly share code, notes, and snippets.

@sycobuny
Created March 15, 2012 02:49
Show Gist options
  • Save sycobuny/2041452 to your computer and use it in GitHub Desktop.
Save sycobuny/2041452 to your computer and use it in GitHub Desktop.
Add Range#overlaps to deal with constructing an OVERLAPS clause for queries in Sequel
class Range
def overlaps(range)
Sequel::SQL::PlaceholderLiteralString.new(
"(?, ?) OVERLAPS (?, ?)",
[
self.first, self.end,
range.first, range.end
],
true
)
end
end
module Sequel
module SQL
class QualifiedIdentifier
def <=>(other)
return 0
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment