| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
method name for Ruby 2.2
|
| |
|
|\
| |
| | |
Add tests to ensure default proc is used when `HashWithIndifferentAccess' is initialized with a block
|
| |
| |
| |
| | |
initialized with a block
|
|/
|
|
|
|
|
|
|
|
| |
This is more consistent than the current behaviour of raising a
`ZeroDivisionError: divided by 0` error when 0 is given, which can be
non-obvious especially if `in_groups_of` is part of a longer chain of
methods.
The negative case was ok - "ArgumentError: invalid slice size" - but
this error is clearer still.
|
|
|
|
| |
Object#to_param at one place and avoid repitition
|
|\
| |
| | |
Move array test files under array
|
| | |
|
| | |
|
|\ \
| |/
|/| |
Define Hash#to_query and set Hash#to_param as alias to it; with test cases
|
| | |
|
| | |
|
| |
| |
| |
| | |
[fixes #16279]
|
|\ \
| | |
| | | |
Added some missing activesupport test coverage
|
| | | |
|
|/ / |
|
| | |
|
|\ \
| | |
| | |
| | | |
Word truncation
|
|/ / |
|
| |
| |
| |
| |
| | |
These methods are not random so they should not belings to SecureRandom
module.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Previously this method always returns `.0` in the fractional part. This commit
changes it to preserve the fractional seconds instead.
Fixes #15994.
|
| |
| |
| |
| |
| | |
Didn't get a chance to convert existing code, I'll skim through the code
base to make use of this later this afternoon.
|
|\ \
| | |
| | |
| | |
| | | |
zuhao/refactor_activesupport_time_zone_test_helpers
Extract out with_env_tz helper method.
|
| | |
| | |
| | |
| | |
| | | |
It’s used at so many places that extracting it out into a helper file
is worth doing.
|
|/ / |
|
| | |
|
| | |
|
|/ |
|
|
|
|
|
| |
Before HashWithIndifferentAccess were doing deep_dup of the inner hashes
when Hash doesn't do. Now both are behaving in the same way.
|
|\
| |
| |
| | |
Fixed `ActiveSupport::TimeWithZone#-` so precision is not unnecessarily lost
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When working with objects with a nanosecond component, the `-` method may
unnecessarily cause loss of precision.
`ActiveSupport::TimeWithZone#-` should return the same result as if we were
using `Time#-`:
Time.now.end_of_day - Time.now.beginning_of_day #=> 86399.999999999
Before:
Time.zone.now.end_of_day.nsec #=> 999999999
Time.zone.now.end_of_day - Time.zone.now.beginning_of_day #=> 86400.0
After:
Time.zone.now.end_of_day - Time.zone.now.beginning_of_day
#=> 86399.999999999
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replacements:
5.ago => 5.seconds.ago
5.until => 5.seconds.until
5.since => 5.seconds.since
5.from_now => 5.seconds.from_now
The removed tests does not affect coverage – we have equivalent test cases in
the tests for `AS::Duration`.
See #12389 for the history and rationale behind this.
|
|\
| |
| |
| | |
Added partial days support to `DateTime`'s `advance` method.
|
| |
| |
| |
| |
| | |
You can now add partial days (e.g. 2.5.days) to `DateTime` with the advance method.
This was acheived by mimicing the `advance` implementation in `Time`.
|
|\ \
| | |
| | | |
Array#to now accept negative position also.
|
| | |
| | |
| | |
| | | |
`Array#to` is working for negative position
|
|/ / |
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Hash#deep_*_keys(!) recurse into nested arrays.
Conflicts:
activesupport/CHANGELOG.md
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Following methods now recursively transform nested arrays, too.
* Hash#deep_transform_keys
* Hash#deep_transform_keys!
* Hash#deep_stringify_keys
* Hash#deep_stringify_keys!
* Hash#deep_symbolize_keys
* Hash#deep_symbolize_keys!
|
| | | |
|
| | |
| | |
| | |
| | | |
Removed `FIMXE` tag to require necessary file but not the whole core_ext
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- Fix `test_to_with_instruct` typo to `test_to_xml_with_instruct`
- Rename `test_to_xml` to `test_to_xml_with_hash_elements` to make test
name more specific.
- Add `test_to_xml_with_non_hash_elements` and
`test_to_xml_with_non_hash_different_type_elements`
`to_xml` behaves different when containing elements are same and
different types.
- Add `test_to_xml_with_indent_set`
|
|\ \ \
| | | |
| | | |
| | | | |
Fix Hash#deep_merge bug and improve documentation — resolves #12738
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Previously merging into a hash with a falsy value would not result in
the merge-block being called. The fix is simply to check for presence
of the key in the hash.
The documentation example for `deep_merge` now appropriately
demonstrates what a deep merge does.
|
|\ \ \ \
| | | | |
| | | | | |
[Fixes #14948] Hash#to_query: right serialization for empty hash and array
|