aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/CHANGELOG.md
diff options
context:
space:
mode:
authorbUg <aleks.grebennik@gmail.com>2012-08-14 20:28:26 +0200
committerbUg <aleks.grebennik@gmail.com>2013-01-04 02:41:09 +0100
commit38f28dca3aa16efd6cc3af6453f2e6b9e9655ec1 (patch)
tree3476dcbf018c506499a04ac3523c369dbbb44c96 /activesupport/CHANGELOG.md
parent4d240ec20a70122b7e69c790a37d2be14e1ff038 (diff)
downloadrails-38f28dca3aa16efd6cc3af6453f2e6b9e9655ec1.tar.gz
rails-38f28dca3aa16efd6cc3af6453f2e6b9e9655ec1.tar.bz2
rails-38f28dca3aa16efd6cc3af6453f2e6b9e9655ec1.zip
Added ability to compare date/time with infinity
Date, DateTime, Time and TimeWithZone can now be compared to infinity, so it's now possible to create ranges with one infinite bound and date/time object as another bound. Ex.: @range = Range.new(Date.today, Float::INFINITY) Also it's possible to check inclusion of date/time in range with conversion. Ex.: @range.include?(Time.now + 1.year) # => true @range.include?(DateTime.now + 1.year) # => true Ability to create date/time ranges with infinite bound is required for handling postgresql range types.
Diffstat (limited to 'activesupport/CHANGELOG.md')
-rw-r--r--activesupport/CHANGELOG.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index 6917be7efc..bee93ebfbc 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -1,5 +1,18 @@
## Rails 4.0.0 (unreleased) ##
+* It's now possible to compare Date, DateTime, Time and TimeWithZone with Infinity
+ This allows to create date/time ranges with one infinite bound.
+ Example:
+
+ range = Range.new(Date.today, Float::INFINITY)
+
+ Also it's possible to check inclusion of date/time in range with conversion.
+
+ range.include?(Time.now + 1.year) # => true
+ range.include?(DateTime.now + 1.year) # => true
+
+ *Alexander Grebennik*
+
* Remove meaningless `ActiveSupport::FrozenObjectError`, which was just an alias of `RuntimeError`.
*Akira Matsuda*