| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
| |
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
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
|/ / / / |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
While calling String#first or String#last with zero or a Fixnum < the
string's length returns a new string, a Fixnum >= the string's length
returns the string itself. This inconsistency can lead to inadvertent
mutation of a string.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
1. Improve tests
2. Remove unnecessary constant
3. Add docs for BigDecimal#duplicable?
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Improve debugging support
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Conflicts:
activerecord/CHANGELOG.md
activesupport/CHANGELOG.md
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This fixes:
1.second.eql?(1.second) #=> false
The new `eql?` requires that `other` is an `ActiveSupport::Duration`.
This requirement makes `ActiveSupport::Duration`'s behavior consistent
with other numeric types in Ruby.
1.eql?(1.0) #=> false
1.0.eql?(1) #=> false
1.second.eql?(1) #=> false (was true)
1.eql?(1.second) #=> false
{ 1 => "foo", 1.0 => "bar" }
#=> { 1 => "foo", 1.0 => "bar" }
{ 1 => "foo", 1.second => "bar" }
# now => { 1 => "foo", 1.second => "bar" }
# was => { 1 => "bar" }
And though the behavior here hasn't changed, for reference:
1 == 1.0 #=> true
1.0 == 1 #=> true
1 == 1.second #=> true
1.second == 1 #=> true
|
|\ \ \ \ \
| |/ / / /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Auto-generate stable fixture UUIDs on PostgreSQL
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/fixtures.rb
activerecord/test/cases/adapters/postgresql/uuid_test.rb
activesupport/CHANGELOG.md
|
| | | | |
| | | | |
| | | | |
| | | | | |
Fixes: #11524
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Active support instead of ActiveSupport::Deprecation.silence we can use assert_deprecated
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
assert_deprecated
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Change to require all active_support/deprecation since that's the actual
entry point for the deprecation methods.
|
| | | | | | |
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Make `#prepend` method modify instance in-place and return self
instead of just returning modified value. That is exactly what
`#prepend!` method was doing previously, so it's deprecated from
now on.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
In particular, `.new`, `#update`, `#merge`, `#replace` all accept
objects which respond to `#to_hash`, even if those objects are not
Hashes directly.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | | |
good, but the closer relationship to #presence over #present is ultimately worth it
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|