| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Similar implementations of #in_time_zone exists for Date, Time and DateTime so
method is extracted into its own module. Also some logic is extracted into
private method.
|
|\
| |
| | |
Added Time#middle_of_day method
|
| |
| |
| |
| | |
Added middle_of_day method to Date and DateTime
|
| |
| |
| |
| |
| |
| | |
Use a lambda to ensure that the generated string respects the offset of
the time value. Also add DateTime#to_s(:iso8601) and Date#to_s(:iso8601)
for completeness.
|
| |
| |
| |
| | |
for easy Javascript date parsing
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This fixes situations where nested NoMethodError exceptions are masked
by delegations. This would cause confusion especially where there was a
problem in the Rails booting process because of a delegation in the
routes reloading code.
Fixes #10559
|
| |
| |
| |
| |
| |
| |
| |
| | |
Rails 4.0.0 fails when trying to encode an ActiveSupport::TimeWithZone
that wraps a DateTime instance. This is fixed on master so add a test
to prevent regression.
(cherry picked from commit ad01b8da354268cebfae1519c28d19d75576ccb1)
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The standard Ruby behavior for Time.at is to return the same type of
time when passing an instance of Time as a single argument. Since the
an ActiveSupport::TimeWithZone instance may be a different timezone than
the system timezone and DateTime just understands offsets the best we
can do is to return an instance of Time with the correct offset.
Fixes #11350.
|
| |
| |
| |
| |
| |
| |
| |
| | |
When Time.at_with_coercion (wraps Time.at) is called with a single
argument that "acts_like?(:time)" it is coerced to integer thus losing
it's microsecond percision.
This commits changes this to use `#to_f` to prevent the problem
|
| |
| |
| |
| |
| | |
Hash#select! returns nil if the hash didn't change and thus behaves differently
from select, so it's return value can't be used as result for the latter.
|
| |
| |
| | |
depreciation removed
|
| |
| |
| | |
core extensions (`core_ext/string/encoding`).
|
| |
| |
| |
| | |
and `Time#local_time` in favour of `Time#utc` and `Time#local`
|
| |
| |
| |
| |
| | |
If you're using it to compare hashes for the purpose of testing,
please use MiniTest's assert_equal instead.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Use native Array#uniq and Array#uniq! instead.
|
| | |
|
|\ \
| | |
| | | |
Create DelegationError class
|
| | | |
|
|\ \ \
| | | |
| | | | |
HashWithIndifferentAccess#select working as intended
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Before this commit, #reject returned a HashWithIndifferentAccess,
whereas #select returned a Hash. Now #select also returns a
HashWithIndifferentAccess.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Add `DateTime#usec` and `DateTime#nsec` so that `ActiveSupport::TimeWithZone`
keeps sub-second resolution when wrapping a `DateTime` value.
Fixes #10855
|
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | | |
Time.at allows passing a single Time argument which is then converted
to an integer. The conversion code since 1.9.3r429 explicitly checks
for an instance of Time so we need to override it to allow DateTime
and ActiveSupport::TimeWithZone values.
|
|\ \ \
| |_|/
|/| | |
Prevent side effects in `Hash#with_indifferent_access`.
|
| | | |
|
|/ /
| |
| |
| | |
with Date)
|
|\ \
| | |
| | | |
test-case for `Array#to_sentence` with `blank?` items.
|
| |/ |
|
|/ |
|
| |
|
|\
| |
| | |
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
|
| | |
|