| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
| |
See [this test](https://gist.github.com/utilum/78918f1b64f8b61ee732cb266db7c43a).
|
|\
| |
| | |
Fix Fixnum deprecated warning in Ruby 2.4+
|
| | |
|
|\ \
| |/
|/| |
Support double-yield inside an around callback
|
| |
| |
| |
| |
| |
| |
| | |
It's questionable whether this is a good thing -- it forces any later/
inner callback to handle multiple invocations, along with the actual
wrapped action. But it worked prior to 871ca21f6a1d65c0ec78cb5a9641411e2210460b,
so we shouldn't break it unintentionally.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In the following situation:
```ruby
class Bar
end
module Baz
end
class Foo
prepend Baz
end
class Foo::Bar
end
```
Running `Inflector.constantize('Foo::Bar')` would blow up with a NameError.
What is happening is that `constatize` was written before the introduction
of prepend, and wrongly assume that `klass.ancestors.first == klass`.
So it uses `klass.ancestors.inject` without arguments, as a result
a prepended module is used in place of the actual class.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This fixes the following warning.
```
test/caching_test.rb:986: warning: parentheses after method name is interpreted as
test/caching_test.rb:986: warning: an argument list, not a decomposed argument
test/cases/adapters/mysql2/reserved_word_test.rb:146: warning: parentheses after method name is interpreted as
test/cases/adapters/mysql2/reserved_word_test.rb:146: warning: an argument list, not a decomposed argument
```
Ref: https://github.com/ruby/ruby/commit/65e27c8b138d6959608658ffce2fa761842b8d24
|
| |
| |
| |
| |
| |
| |
| | |
`NilClass`, `FalseClass`, `TrueClass`, `Symbol` and `Numeric` can dup
with Ruby 2.4+.
Ref: https://bugs.ruby-lang.org/issues/12979
|
| | |
|
|/
|
|
| |
https://bugs.ruby-lang.org/issues/12979
|
|
|
|
|
|
|
|
| |
This behavior changed in Ruby starting with 2.3.0, as a result of
https://bugs.ruby-lang.org/issues/11360. This results in a change in
behavior of these methods which is likely undesirable.
Fixes #27238
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to this commit, `3.months - 3.months` would result in a duration
that has the "parts" of `[[:months, 3], [:months, -3]]`. This would mean
that it was subtly different than `2.months - 2.months`. When applied to
a time, the date might actually change if the resulting day doesn't
exist however many months in the future, even though in both cases we
just wanted to add `0`, which should always be an identity operation.
With this change, we now store the parts as a hash, so `3.months -
3.months` is simply stored as `{ months: 0 }`.
|
|
|
|
| |
Follow up to #18767
|
|\
| |
| | |
`Broadcast#silence` breaks custom loggers that do not include `Logg…
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
This fixes an error where the test runner would try and run
XMLMiniEngineTest like a normal test class, except it's abstract. Now,
to circumvent this, we don't include any of the actual tests in
XMLMiniEngineTest; they are wrapped in a module that is included in
subclass when they inherit from XMLMiniEngineTest. Pretty neat, huh?
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
Created a new module (a la Action Cable subscription adapter's test
suite) to be included in all sub class test to ensure compatability and
reduce duplicated code.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Will help get rid of errors like the following:
```
1) Error:
JDOMEngineTest#test_order=:
ArgumentError: wrong number of arguments (0 for 1)
/Users/jon/code/rails/rails/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb:106:in `test_order='
```
|
| |
| |
| |
| |
| |
| |
| |
| | |
The issue presented in #26246 showed a deeper underlying problem. When
we fell back to the exception handler for an exceptions cause, we were
calling that handler with the outer raised exception. This breaks the
calling code's expectations, especially if the exception has methods on
it behond those from `StandardError`.
|
|\ \
| | |
| | | |
Remove Active Support deprecations
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit bad3a120f1690f393d8f6204b3ceee60f0ce707b, reversing
changes made to 2384317465ccb1dfca456a2b7798714b99f32711.
Reason: Adding a new option in the API for something that can be done
with a `#presence` check could do.
|
|/ /
| |
| |
| | |
value. See also http://patshaughnessy.net/2014/1/9/how-big-is-a-bignum for smallest bignum value
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Using the method you're testing to generate expected
values can lead to bugs being masked.
|
|\ \
| | |
| | | |
Fix an issue with JSON encoding of "Infinity" and "NaN" values
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- When `as_json` returns `Infinity` or `NaN` as the value of any of the key,
we don't used to call `as_json` on it as it was treated as primitive.
- This used to pass `Infinity` or `NaN` to `JSON.generate` and Ruby used
to throw an error for `Infinity/NaN not allowed in JSON.`
- This patch changes the code to call `as_json` on these primitives so
that they are converted to proper values before being passed to
`JSON.generate`.
- Fixes #26877.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
2.3: sprintf('%0.1f', 5.55) #=> "5.5"
2.4: sprintf('%0.1f', 5.55) #=> "5.6"
see: https://github.com/ruby/ruby/commit/6ed8c79ddb11ccfb580bb0a22b22cc1362250255 and
https://github.com/ruby/ruby/commit/295f60b94d5ff6551fab7c55e18d1ffa6a4cf7e3
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously `ActiveSupport::Duration.parse` used `Time.current` and
`Time#advance` to calculate the number of seconds in the duration
from an arbitrary collection of parts. However as `advance` tries to
be consistent across DST boundaries this meant that either the
duration was shorter or longer depending on the time of year.
This was fixed by using an absolute reference point in UTC which
isn't subject to DST transitions. An arbitrary date of Jan 1st, 2000
was chosen for no other reason that it seemed appropriate.
Additionally, duration parsing should now be marginally faster as we
are no longer creating instances of `ActiveSupport::TimeWithZone`
every time we parse a duration string.
Fixes #26941.
|
|/ |
|
|\
| |
| | |
Fix `ActiveSupport::TimeZone#strptime` cannot parse timestamps (%Q, %s)
|
| | |
|
|/ |
|