| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Fixes #16956.
|
|\
| |
| | |
Grammar correction in ActiveSupport CHANGELOG [ci skip]
|
| | |
|
|\|
| |
| | |
[ci skip] ActiveSupport CHANGELOG fixes
|
| |
| |
| |
| |
| |
| |
| | |
1. spacing issues
2. spelling correction
3. grammar correction
4. Add missing docs
|
|\ \
| |/
|/|
| |
| |
| |
| |
| |
| | |
Added method `#eql?` to `ActiveSupport::Duration`, in addition to `#==`.
Conflicts:
activesupport/CHANGELOG.md
activesupport/lib/active_support/duration.rb
activesupport/test/core_ext/duration_test.rb
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently, the following returns `false`, contrary to expectation:
1.minute.eql?(1.minute)
Adding method `#eql?` will make this behave like expected. Method `#eql?` is
just a bit stricter than `#==`, as it checks whether the argument is also a
uration. Their parts may be different though.
1.minute.eql?(60.seconds) # => true
1.minute.eql?(60) # => false
|
| |
| |
| |
| | |
Closes #16392.
|
| |
| |
| |
| |
| | |
Otherwise this will lead to another error later on
when generating a signature:
TypeError (no implicit conversion of nil into String).
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Goals:
1. Default to :random for newly generated applications
2. Default to :sorted for existing applications with a warning
3. Only show the warning once
4. Only show the warning if the app actually uses AS::TestCase
Fixes #16769
|
| |
| |
| |
| |
| |
| | |
Fixes #8015, #9756.
[Fred Wu & Matthew Draper]
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
https://github.com/rails/rails/commit/98b46bf5e201307cae56ee14bf41363a539779c5
did not properly handled out-of-range `:usec`s.
Passing a `:usec` that's out of range now throws an `ArgumentError` as it
should.
Fixes #16759.
|
| | |
|
|\ \
| | |
| | |
| | |
| | |
| | | |
tgxworld/dont_swallow_error_when_identifying_constant_from_test_name
Do not swallow exception on NameError within constant.
|
|/ / |
|
| |
| |
| |
| | |
just needed some tenderloving instance_eval to fit the bill
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
For the sake of backward-compatibility, we need to make #instance_of?
return true for Fixnum. On the other hand, the method should still
give true for ActiveSupport::Duration itself which was not the case
before.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since Duration is extending from ProxyObject which extends itself from
BasicObject, the Duration object doesn't respond to the #instance_of?
method. Thus, the #method_missing hook get triggered, delegating the
method to its `value` attribute.
However, Rubinius' #eql? definition relies on #instance_of?, thus this
will equal to true with a Fixnum (since its `value` attribute is a
Fixnum) while it should not.
The previous behavior was wrong anyway, no matter the implementation.
|
| |
| |
| |
| | |
to zero, so we only travel with per-second precision, not anything deeper than that.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Fixes #16406
|
| | |
|
| |
| |
| |
| | |
method name for Ruby 2.2
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`Time#as_json`, `Date#as_json` and `DateTime#as_json` incorrectly depends on a
delegation that is set up in `active_support/json/encoding`. We cannot simply
require that file in `core_ext/object/json` because it would cause a circular
dependency problem (see #12203 for background). We should instead rely on AS's
autoload to load that file for us on-demand.
To trigger autoload correctly, we need to reference the `AS::JSON::Encoding`
constant instead of using the delegated version.
Fixes #16131.
|
| |
| |
| |
| | |
[fixes #16279]
|
|\ \
| | |
| | |
| | | |
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.
|
| |
| |
| |
| | |
[ci skip]
|
|\ \
| | |
| | |
| | | |
Always instrument ActiveSupport::Cache
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since d3071db1, the apply_inflections method check if the downcased
version of a string is contained inside the "whitelist" of uncountable
words. However, if the word is composed of capital letters, it won't be
matched in the list while it should.
We can't simply revert to the previous behavior as there is a
performance concern (benchmarked over /usr/share/dict/words):
Before d3071db1 135.610000 0.290000 135.900000 (137.807081)
Since d3071db1 22.170000 0.020000 22.190000 ( 22.530005)
With the patch 22.060000 0.020000 22.080000 ( 22.125771)
Benchmarked with http://git.io/aFnWig
This way, the solution is to put the down-case version of words inside
the @uncountables array.
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
: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.
|
| | | |
|