| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Based on commit 5e51bdda.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* The assertions in AS::Duration don't actually assert.
* The assertion in Railtie will pass even when `eager_load_namespaces`
doesn't include `AppTemplate::Application` if `Rails.application` is
truthy.
For more details, see here:
* https://github.com/rails/rails/pull/16998
* https://github.com/rails/rails/pull/17000
|
|
|
|
| |
Fixes #16956.
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| | |
Ruby 2.2 knows this, and no longer matches it with [[:space:]], so it's
not a good candidate for testing String#squish.
|
| | |
|
| |
| |
| |
| | |
Closes #16392.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| | |
This was removed by mistake in 5e51bdd
|
| |
| |
| |
| | |
just needed some tenderloving instance_eval to fit the bill
|
| |
| |
| |
| | |
:trollface:
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since Rubinius is relying on #instance_of? for its definition of #eql?
(http://git.io/MtmbbA) but ActiveSupport::Duration should behave like
is_a? it returns true with `Fixnum`.
Thus, for the moment, the last assertion is failing so we have to skip
this test.
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| | |
Fixes #16406
|
| | |
|
| |
| |
| |
| | |
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.
|
|/ / / |
|