| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
fix HashWithIndifferentAccess#to_hash behaviour
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
commit 2683de5da85135e8d9fe48593ff6167db9d64b18
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date: Fri May 3 11:29:20 2013 -0700
cannot support infinite ranges right now
commit cebb6acef2c3957f975f6db4afd849e535126253
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date: Fri May 3 11:26:12 2013 -0700
reverting infinity comparison
commit 385f7e6b4efd1bf9b89e8d607fcb13e5b03737ea
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date: Fri May 3 11:23:28 2013 -0700
Revert "Added ability to compare date/time with infinity"
This reverts commit 38f28dca3aa16efd6cc3af6453f2e6b9e9655ec1.
Conflicts:
activesupport/CHANGELOG.md
activesupport/lib/active_support/core_ext/numeric/infinite_comparable.rb
activesupport/test/core_ext/date_ext_test.rb
activesupport/test/core_ext/date_time_ext_test.rb
activesupport/test/core_ext/numeric_ext_test.rb
activesupport/test/core_ext/time_ext_test.rb
activesupport/test/core_ext/time_with_zone_test.rb
commit 0d799a188dc12b18267fc8421675729917610047
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date: Fri May 3 11:18:53 2013 -0700
Revert "Refactor infinite comparable definition a bit"
This reverts commit dd3360e05e4909f2f0c74a624cccc2def688f828.
commit 42dec90e49745bbfae546f0560b8783f6b48b074
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date: Fri May 3 11:18:47 2013 -0700
Revert "Require 'active_support/core_ext/module/aliasing' in the infinite_comparable module"
This reverts commit 7003e71c13c53ec3d34250560fbf80b8381df693.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit ebf69ab1636df74c76332c53bcd3d8494fb91b45.
`in?` must not take multiple parameters because its behavior would be
ambiguous:
# Test if "B" is included in a list of names with `"B".in?(*names)`:
names = ["BMorearty"]
"B".in?(*names) # => true
names = ["BMorearty","rubyduo"]
"B".in?(*names) # => false
Conflicts:
activesupport/lib/active_support/core_ext/object/inclusion.rb
activesupport/test/core_ext/object/inclusion_test.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
and avoids multiple evaluation of the target method
Notes:
1) I hope nilness is a word.
2) See rationale for avoiding multiple evaluation in a comment in the patch, credit goes to @jeremy for pointing out this gotcha in the existing implementation.
3) Embeds a little joke dedicated to @pixeltrix (it could be worse! :D).
References #10347.
|
|\ \
| | |
| | |
| | |
| | | |
JonRowe/update_as_date_next_week_to_document_intent
Propose better documentation for ActiveSupports `next_week` functionaility
|
| | | |
|
|/ /
| |
| |
| |
| |
| | |
Add documentation and test to delegation method that make sure we're
aware that when a delegated object is not nil or false and doesn't
respond to the method it will still raise a NoMethodError exception.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The changes in b79adc4323 had a bug where if the time in the String
was in standard time but the current time was in daylight savings then
the calculated adjustment was off by an hour.
This commit fixes this and adds extra tests for the following:
* time in string is standard time, current time is standard time
* time in string is standard time, current time is daylight savings
* time in string is daylight savings, current time is standard time
* time in string is daylight savings, current time is daylight savings
Fixes #10306.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Closes #9772.
`TimeWithZone` delegates everything to the wrapped `Time` object
using `method_missing`. The result is that `NoMethodError` error
will be raised in the context of `Time` which leads to a misleading
debug output.
|
|\
| |
| | |
remove unused parameter passed to assert_query_equal method
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
since it's allowed by the spec and is very useful.
|
|\
| |
| | |
Improve String#squish whitespaces matching
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
* ASCII_STRING was not an ASCII String
* BYTE_STRING was not an in valid UTF-8 String
* added an assertion for non-UTF-8 String
|
| | |
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
Use the standard library's `DateTime.parse` because it's marginally
faster and supports partial date/time strings.
Benchmark:
user system total real
old 3.980000 0.000000 3.980000 ( 3.987606)
new 3.640000 0.010000 3.650000 ( 3.641342)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit standardises the return value of `to_time` to an instance
of `Time` in the local system timezone, matching the Ruby core and
standard library behavior.
The default form for `String#to_time` has been changed from :utc to
:local but research seems to suggest the latter is the more common form.
Also fix an edge condition with `String#to_time` where the string has
a timezone offset in it and the mode is :local. e.g:
# Before:
>> "2000-01-01 00:00:00 -0500".to_time(:local)
=> 2000-01-01 05:00:00 -0500
# After:
>> "2000-01-01 00:00:00 -0500".to_time(:local)
=> 2000-01-01 00:00:00 -0500
Closes #2453
|
|
|
|
| |
Closes #8587
|
| |
|
|
|
|
|
| |
This reverts commit 88cc1688d0cb828c17706b41a8bd27870f2a2beb, reversing
changes made to f049016cd348627bf8db0d72382d7580bf802a79.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
I did this because to_date gives a very unhelpful error message if you
do not pass in a correct date. In the process I think this cleans up the
code nicely and even better it tends to be slightly faster than the
current implementation.
Benchmark
https://gist.github.com/4440875
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|\
| |
| | |
WIP Refactor xml conversion to hash
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Three basic refactors in this PR:
* We extracted the logic into a method object. We now don't define a tone of extraneous methods on Hash, even if they were private.
* Extracted blocks of the case statement into methods that do the work. This makes the logic more clear.
* Extracted complicated if clauses into their own query methods. They often have two or three terms, this makes it much easier to see what they _do_.
We took care not to refactor too much as to not break anything, and put comments where we suspect tests are missing.
We think ActiveSupport::XMLMini might be a good candidate to move to a plugin in the future.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
The Time.time_with_datetime_fallback, Time.utc_time and Time.local_time
methods were added to handle the limitations of Ruby's native Time
implementation. Those limitations no longer apply so we are deprecating
them in 4.0 and they will be removed in 4.1.
|
| | |
|