diff options
Diffstat (limited to 'lib/arel/engines/sql/extensions/range.rb')
-rw-r--r-- | lib/arel/engines/sql/extensions/range.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/arel/engines/sql/extensions/range.rb b/lib/arel/engines/sql/extensions/range.rb new file mode 100644 index 0000000000..25bf1d01da --- /dev/null +++ b/lib/arel/engines/sql/extensions/range.rb @@ -0,0 +1,15 @@ +module Arel + module Sql + module RangeExtensions + def to_sql(formatter = nil) + formatter.range self.begin, self.end + end + + def inclusion_predicate_sql + "BETWEEN" + end + + Range.send(:include, self) + end + end +end |