| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \
| | |
| | |
| | |
| | | |
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.
|
|/ / |
|
|\ \
| | |
| | | |
Add test cases for Hash#asset_valid_keys
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Clean up I18n stored translations after test
continuation with #15714
|
|/ / |
|
| | |
|
|\ \
| | |
| | | |
Add test cases for #in? and #presence_in
|
| |/ |
|
|/ |
|
|
|
|
|
| |
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
|
|\ \
| | |
| | | |
Test `except!` in other cases too
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
:precision was incorrectly being applied to Rationals
before:
ActiveSupport::NumberHelper.number_to_rounded Rational(10, 3), precision: 2
=> "3.3"
after:
ActiveSupport::NumberHelper.number_to_rounded Rational(10, 3), precision: 2
=> "3.33"
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
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`.
|
|\ \
| | |
| | |
| | | |
Fix test cases for inflector.rb
|
|/ /
| |
| |
| |
| |
| | |
`yield` was missing in #with_dup, due to which 57 assertions were not running
in real, and all tests were passing by default.
Error was introduced in commit - 31ceb5e.
|
|\ \
| | |
| | | |
Array#to now accept negative position also.
|
| | |
| | |
| | |
| | | |
`Array#to` is working for negative position
|
|\ \ \
| |/ /
|/| | |
add test cases for negative position in Array#from
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| | |
We need to test if the same method defined more than once only register
one subscriber for it. We can safelly remove because the method body is
the same and Subscriber use method_added hook for register the
subscriber.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
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!
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
roccoblues/fix_duplicate_activesupport_subscribers
Fixed duplicate subscribers in ActiveSupport::Subscriber
Conflicts:
activesupport/CHANGELOG.md
|
| | | |
| | | |
| | | |
| | | |
| | | | |
ActiveSupport::Subscriber no longer creates multiple subscribers when
you redefine a method.
|
|\ \ \ \
| | | | |
| | | | | |
[Fixes #15064] Calling number_to_delimited on a ActiveSupport::SafeBuffer results in mangled output
|
| | | | |
| | | | |
| | | | |
| | | | | |
rather than use non-public SafeBuffer API.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
`ActiveSupport::SafeBuffer` values aren't mangled.
Fixes #15064
|
| | | | |
| | | | |
| | | | |
| | | | | |
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`
|
| | | | |
|
|/ / /
| | |
| | |
| | |
| | | |
Namely, if the mday is omitted but any other upper components are, then instead
of supplying the mday from the current time, it defaults to 1.
|
|\ \ \
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* Strips leading underscores.
* Changes some unnecessary gsub!s to sub!s.
* Replaces some anchors ^, $ with \A, \z.
* Documents that human inflection rules are applied.
* Documents that words are downcased except acronyms.
* Adds an example with an acronym.
* Rewords docs.
|
|\ \ \ \
| | | | |
| | | | | |
[Fixes #14948] Hash#to_query: right serialization for empty hash and array
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
are serialized
Empty Hash or Array should not present in serialization result
{a: []}.to_query # => ""
{a: {}}.to_query # => ""
For more info see #14948.
|
|/ / / /
| | | |
| | | |
| | | | |
test case.
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Fix inconsistent behavior from String#pluralize
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Before:
When calling String#pluralize with count=1 then it returned same
string, but with count other than 1, returned new string.
After:
String#pluralize always return a new string.
=> Prevent mutation of a string inadvertently.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
multibyte_conformance.rb --> multibyte_conformance_test.rb
|