aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/engines/sql/extensions/range.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/engines/sql/extensions/range.rb')
-rw-r--r--lib/arel/engines/sql/extensions/range.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/arel/engines/sql/extensions/range.rb b/lib/arel/engines/sql/extensions/range.rb
index 946dbc2633..25bf1d01da 100644
--- a/lib/arel/engines/sql/extensions/range.rb
+++ b/lib/arel/engines/sql/extensions/range.rb
@@ -1,9 +1,15 @@
-class Range
- def to_sql(formatter = nil)
- formatter.range self.begin, self.end
- end
+module Arel
+ module Sql
+ module RangeExtensions
+ def to_sql(formatter = nil)
+ formatter.range self.begin, self.end
+ end
- def inclusion_predicate_sql
- "BETWEEN"
+ def inclusion_predicate_sql
+ "BETWEEN"
+ end
+
+ Range.send(:include, self)
+ end
end
end