| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Use frozen-string-literal in ActiveSupport
|
| | |
|
|\ \
| | |
| | | |
Mention Time.zone.parse possibly throwing ArgumentError
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
```
/Users/kamipo/src/github.com/rails/rails/activesupport/test/core_ext/module_test.rb:402: warning: `*' interpreted as argument prefix
/Users/kamipo/src/github.com/rails/rails/activesupport/test/core_ext/module_test.rb:420: warning: `*' interpreted as argument prefix
```
|
|\ \ \
| |_|/
|/| |
| | | |
Return prefixed method names from `Module.delegate`, if using prefixes
|
|/ /
| |
| |
| | |
if using prefix version.
|
| | |
|
| |
| |
| |
| |
| | |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
|\ \
| | |
| | |
| | | |
Enforce frozen string in Rubocop
|
| | | |
|
|\ \ \
| |/ /
|/| |
| | | |
Make ActiveSupport frozen-string-literal friendly.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The ActiveSupport test suite only passes currently if it uses the latest unreleased commits for dalli, and a patch for Builder:
https://github.com/tenderlove/builder/pull/6
Beyond that, all external dependencies (at least, to the extent they’re used by ActiveSupport) are happy, including Nokogiri as of 1.8.0.
|
|/ / |
|
| |
| |
| |
| |
| |
| | |
No need to pass `#cleanup` options through to `LocalCache#clear`.
Fixes #29081. References #25628.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Split up the caching tests as prep for adding a new cache store. Slices
the mega test/caching_test.rb into behavior modules, concrete store
tests, and cross-cutting store tests.
Considering moving cache store behavior modules into lib/ so they may be
used for acceptance testing by third parties.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Rails.cache.write_multi foo: 'bar', baz: 'qux'
Plus faster `fetch_multi` with stores that implement `write_multi_entries`.
Keys that aren't found may be written to the cache store in one shot
instead of separate writes.
The default implementation simply calls `write_entry` for each entry.
Stores may override if they're capable of one-shot bulk writes, like
Redis `MSET`.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Allow a default value to be declared for class_attribute
* Convert to using class_attribute default rather than explicit setter
* Removed instance_accessor option by mistake
* False is a valid default value
* Documentation
|
|\ \
| | |
| | | |
round before calculating exponent in number_to_human_converter
|
| | |
| | |
| | |
| | | |
fixes #25664
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | | |
EilisHamilton/fix_uncountable_pluralization_locale
Fix pluralization of uncountables when given a locale
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Previously apply_inflections would only use the :en uncountables
rather then the ones for the locale that was passed to pluralize or
singularize.
This changes apply_inflections to take a locale which it will use to
find the uncountables.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
singleton (#29180)
* Add ActiveSupport::CurrentAttributes to provide a thread-isolated attributes singleton
* Need to require first
* Move stubs into test namespace.
Thus they won't conflict with other Current and Person stubs.
* End of the line for you, whitespace!
* Support super in attribute methods.
Define instance level accessors in an included module such that
`super` in an overriden accessor works, akin to Active Model.
* Spare users the manual require.
Follow the example of concerns, autoload in the top level Active Support file.
* Add bidelegation support
* Rename #expose to #set. Simpler, clearer
* Automatically reset every instance.
Skips the need for users to actively embed something that resets
their CurrentAttributes instances.
* Fix test name; add tangible name value when blank.
* Try to ensure we run after a request as well.
* Delegate all missing methods to the instance
This allows regular `delegate` to serve, so we don't need bidelegate.
* Properly test resetting after execution cycle.
Also remove the stale puts debugging.
* Update documentation to match new autoreset
|
|\ \ \ \
| | | | |
| | | | | |
Remove unused test class
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
`AlsoDoingNothingTest` was added in cf9be89.
It seems that it added to confirm that the test works in the child class
of `ActiveSupport::TestCase`.
But now basically use `ActiveSupport::TestCase` in test, so I think
it is unnecessary.
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | | |
".. with __dir__ we can restore order in the Universe." - by @fxn
Related to 5b8738c2df003a96f0e490c43559747618d10f5f
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously calculations where the scalar is first would be converted
to a duration of seconds but this causes issues with dates being
converted to times, e.g:
Time.zone = "Beijing" # => Asia/Shanghai
date = Date.civil(2017, 5, 20) # => Mon, 20 May 2017
2 * 1.day # => 172800 seconds
date + 2 * 1.day # => Mon, 22 May 2017 00:00:00 CST +08:00
Now the `ActiveSupport::Duration::Scalar` calculation methods will try
to maintain the part structure of the duration where possible, e.g:
Time.zone = "Beijing" # => Asia/Shanghai
date = Date.civil(2017, 5, 20) # => Mon, 20 May 2017
2 * 1.day # => 2 days
date + 2 * 1.day # => Mon, 22 May 2017
Fixes #29160, #28970.
|
| | | |
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
Message encryptor auth tag check
Fixes MessageEncryptor when used in AEAD mode. Specifically, we need to check if the `auth_tag` is nil. This may arise when an AEAD encryptor is used to decrypt a ciphertext generated from a different mode, such as CBC-HMAC. Basically, the number of double dashes will differ and `auth_tag` may be nil in this case.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
When MessageEncryptor tries to +decrypt_and_verify+ ciphertexts
generated in a different mode (such CBC-HMAC), the +auth_tag+ may be
+nil+ and must explicitly check for it.
See the discussion here:
https://github.com/rails/rails/pull/28132#discussion_r116388462
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Some cache backends support the `unless_exist` option, which tells them
not to overwrite an existing entry. The local cache currently always
stores the new value, even though the backend may have rejected it.
Since we can't tell which value will end up in the backend cache, we
should delete the key from the local cache, so that the next read for
that key will go to the backend and pick up the correct value.
|
|\ \ \ \
| | | | |
| | | | | |
Handle loops in the cause chain in Rescuable#rescue_with_handler
|
| | | | | |
|
|/ / / / |
|
| | | |
| | | |
| | | | |
The method is named `delegate_missing_to`, not `delegate_to_missing`
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The Enumerator#size method was introduced in Ruby 2.0.
These tests were added when Rails 4.1 was current, and Ruby 1.9.3 was
still supported. Since Rails 5 only Ruby >= 2.2.2 is supported, so the
checks are no longer necessary.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
handler, and make sure they are used for the ActiveSupport::Notifications message.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Support `:offset` in `Time#change` and `:zone` or `:offset`
in `ActiveSupport::TimeWithZone#change`.
Fixes #28723.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`fetch_values` was added to Hash in Ruby 2.3.0:
https://bugs.ruby-lang.org/issues/10017
This patch adds an implemention for instances of HWAI, in line
with the existing definitions of `fetch` and `values_at`.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
So we shouldn't claim they're there, even when asked explicitly.
|
| |_|/
|/| |
| | |
| | |
| | |
| | | |
HashWithIndifferentAccessTest::HashWithIndifferentAccess`
Caused since #28607.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
In the context of controller parameters, reverse_merge is commonly used
to provide defaults for user input. Having an alias to reverse_merge
called with_defaults feels more idiomatic for Rails.
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | | |
mubashirhanif/add_keep_id_suffix_option_to_humanize_new
Add keep id suffix option to humanize new
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
some documentation
remove extra whitespace.
Added id in the middle test case and corrected some testcases.
Some Coding standard guidelines corrections as suggested by codeclimate.
Some more corrections suggested by codeclimate.
|