aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
Commit message (Collapse)AuthorAgeFilesLines
* Use `SecureRandom.random_bytes` instead of `SecureRandom.bytes`yuuji.yaginuma2018-04-131-1/+1
| | | | | | | | | | `SecureRandom.byes` was added in Ruby 2.4. So, 5-2-stable build is broken because using `SecureRandom.bytes`. https://travis-ci.org/rails/rails/jobs/365740667 Also, `SecureRandom.byes` seems to an undocumented method. If need random binary strings, should use `SecureRandom.random_bytes`. https://github.com/ruby/ruby/blob/trunk/lib/securerandom.rb
* Merge pull request #32551 from chrisarcand/no-doc-original-sumRafael França2018-04-121-1/+1
|\ | | | | Don't doc _original_sum_with_required_identity
| * Don't doc _original_sum_with_required_identityChris Arcand2018-04-121-1/+1
| | | | | | | | It's not public API so don't document it.
* | Merge pull request #32539 from chancancode/anticompressRafael França2018-04-125-73/+181
|\ \ | |/ |/| Fix ActiveSupport::Cache compression
| * Fix `ActiveSupport::Cache` compressionGodfrey Chan2018-04-113-37/+60
| | | | | | | | (See previous commit for a description of the issue)
| * Add failing test for compression bugGodfrey Chan2018-04-113-38/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | On Rails 5.2, when compression is enabled (which it is by default), the actual value being written to the underlying storage is actually _bigger_ than the uncompressed raw value. This is because the `@marshaled_value` instance variable (typically) gets serialized with the entry object, which is then written to the underlying storage, essentially double-storing every value (once uncompressed, once possibly compressed). This regression was introduced in #32254.
* | Merge pull request #32542 from ↵George Claghorn2018-04-121-2/+3
|\ \ | | | | | | | | | | | | teddywing/active-support-cache-store--fix-end-tag-in-read-method-documentation Cache::Store#read: Fix fixed-width end tag in docs
| * | Cache::Store#read: Fix fixed-width end tag in docsTeddy Wing2018-04-121-2/+3
| |/ | | | | | | | | | | | | | | * Fix the ending `</tt>` tag for `:expires_in`. Otherwise, the "or" is set in fixed-width also. * Re-wrap paragraph to 80 columns. [ci skip]
* | Merge pull request #31913 from rywall/define-callbacks-descMatthew Draper2018-04-122-1/+13
|\ \ | |/ |/| Define callbacks on descendants.
| * No need to define methods on descendants.Ryan Wallace2018-02-241-18/+18
| | | | | | | | Addresses feedback from https://github.com/rails/rails/pull/31913#issuecomment-365983580
| * Define callbacks on descendants.Ryan Wallace2018-02-062-17/+29
| | | | | | | | We set callbacks on all descendants, so we need to make sure that they are also defined on all descendants as well.
* | Fix test class name for `Assertions` moduleyuuji.yaginuma2018-04-081-1/+1
| | | | | | | | | | Because this class includes not only `assert_difference` but also tests of other assertion methods.
* | Rename the class as there is already an existing class with that nameEdouard CHIN2018-04-061-1/+1
| |
* | `SetupAndTeardown#teardown` should call any subsequent after_teardown:Edouard CHIN2018-04-062-1/+42
| | | | | | | | | | | | | | | | If you have a regular test that have a teardown block, and for any reason an exception get raised, ActiveSupport will not run subsequent after_teardown method provided by other module or gems. One of them being the ActiveRecord::TestFixtures which won't rollback the transation when the test ends making all subsequent test to be in a weird state. The default implementation of minitest is to run all teardown methods from the user's test, rescue all exceptions, run all after_teardown methods provided by libraries and finally re-raise the exception that happened in the user's teardown method. Rails should do the same.
* | Merge pull request #32441 from composerinteralia/refute-notRafael França2018-04-041-2/+2
|\ \ | | | | | | Add custom RuboCop for `assert_not` over `refute`
| * | Autocorrect `refute` RuboCop violationsDaniel Colson2018-04-031-2/+2
| | | | | | | | | | | | | | | | | | 73e7aab behaved as expected on codeship, failing the build with exactly these RuboCop violations. Hopefully `rubocop -a` will have been enough to get a passing build!
* | | [ci skip] Add :private option to delegation docYoshiyuki Hirano2018-04-051-1/+2
| | |
* | | Small doc fixesT.J. Schuck2018-04-021-4/+4
|/ / | | | | | | [ci skip]
* | Merge pull request #32268 from freeletics/encrypted-tmp-file-nameKasper Timm Hansen2018-04-011-1/+1
|\ \ | | | | | | Change temporary file name extension while editing encrypted file.
| * | Change temporary file name extension while editing encrypted file.Wojciech Wnętrzak2018-03-181-1/+1
| | | | | | | | | | | | To have syntax highlighting in an editor try to preserve original extension of edited file.
* | | Move implementation of `before?` and `after?` to `DateAndTime::Calculations`bogdanvlviv2018-03-318-42/+22
| | | | | | | | | | | | | | | | | | | | | | | | This prevents duplication of code. Prevent duplication of tests by moving them to `DateAndTimeBehavior`. Related to #32185.
* | | Fix: FileStoreTest#test_filename_max_size fails in Ruby 2.5.1utilum2018-03-311-1/+3
| | |
* | | Adding missing extension for `cattr_accessor` methodWojciech Wnętrzak2018-03-301-0/+1
| | |
* | | Merge pull request #32185 from nholden/human_readable_date_time_comparisonsRafael França2018-03-269-0/+63
|\ \ \ | | | | | | | | Add `before?` and `after?` methods to date and time classes
| * | | Add `before?` and `after?` methods to date and time classesNick Holden2018-03-069-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Equality comparisons between dates and times can take some extra time to comprehend. I tend to think of a date or time as "before" or "after" another date or time, but I naturally read `<` and `>` as "less than" and "greater than." This change seeks to make date/time comparisons more human readable.
* | | | Remove unused `serialize` methodyuuji.yaginuma2018-03-251-4/+0
| | | |
* | | | Merge pull request #32315 from huacnlee/fix/local-cache-read-multi-entry-returnRafael França2018-03-222-1/+20
|\ \ \ \ | | | | | | | | | | Fix Cache `read_multi` with local_cache bug, should returns raw value, not `ActiveSupport::Cache::Entry` instance.
| * | | | Fix Cache `read_multi` with local_cache return values.Jason Lee2018-03-212-1/+20
| | | | | | | | | | | | | | | | | | | | It should returns raw value, not instance of `ActiveSupport::Cache::Entry`.
* | | | | Remove unused variableRafael Mendonça França2018-03-221-1/+0
| | | | |
* | | | | Ruby 2.6 will not require monkey patched `URI#unescape`Yasuo Honda2018-03-221-9/+1
| | | | | | | | | | | | | | | | | | | | since revision 62897 https://github.com/ruby/ruby/commit/234a30459cdae6aa7da6e28a1082d9c11f315696
* | | | | Use try in tests that try to test try.Kasper Timm Hansen2018-03-211-7/+2
|/ / / /
* | / / Fix unclosed tags in `RedisCacheStore` docs [ci skip]yuuji.yaginuma2018-03-191-1/+1
| |/ / |/| |
* | | Don't marshal ActiveSupport::Cache::Entry objects twiceSean Griffin2018-03-141-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | When upgrading to Rails 5.2 we're seeing `ActiveSupport::Cache::Entry#compress` and `ActiveSupport::Cache::Entry#should_compress?` as the highest usage of our CPU. At least some part of this is coming from the fact that objects are being marshaled multiple times. This memoizes the marshaled value to eliminate half the problem.
* | | Remove changelog header for unreleased versionRafael Mendonça França2018-03-131-2/+0
| | | | | | | | | | | | | | | | | | We only add the header when releasing to avoid some conflicts. [ci skip]
* | | Redis cache store: fix constructing with a Redis instanceAdam Richardson2018-03-122-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | Since `Redis#call` duck types as a Proc, we'd call `#call` on it, thinking it's a Proc. Fixed by check for the Proc explicitly instead of duck typing on `#call`. References #32233
* | | Fix CHANGELOGs [ci skip]bogdanvlviv2018-03-121-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | - Add missing dots. - Remove reference to itself on GitHub. Usually, we add references to fixed issues only in a changelog. Follow up #32223
* | | Only apply monkey-patch if detected to be requiredAshe Connor2018-03-091-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We test the failing case we're trying to patch; only if it throws an Exception do we patch. Currently this will *always* throw, but upstream Ruby has patched this bug: https://git.io/vAxKB Signed-off-by: Ashe Connor <ashe@kivikakk.ee>
* | | Merge pull request #32183 from kivikakk/uri-ext-fixEileen M. Uchitelle2018-03-073-2/+12
|\ \ \ | |/ / |/| | URI.unescape "extension" fails with Unicode input
| * | URI.unescape handles mixed Unicode/escaped inputAshe Connor2018-03-073-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, URI.enscape could handle Unicode input (without any actual escaped characters), or input with escaped characters (but no actual Unicode characters) - not both. URI.unescape("\xe3\x83\x90") # => "バ" URI.unescape("%E3%83%90") # => "バ" URI.unescape("\xe3\x83\x90%E3%83%90") # => # Encoding::CompatibilityError We need to let `gsub` handle this for us, and then force back to the original encoding of the input. The result String will be mangled if the percent-encoded characters don't conform to the encoding of the String itself, but that goes without saying. Signed-off-by: Ashe Connor <ashe@kivikakk.ee>
* | | [ci skip] Hide internal docs from root AS moduleAshe Connor2018-03-061-0/+1
|/ / | | | | | | | | | | | | | | | | We have a bunch of documentation in lib/active_support/core_ext/object/json.rb which is currently appearing as documentation for the top-level ActiveSupport module. We hide it from rdoc here. Signed-off-by: Ashe Connor <ashe@kivikakk.ee>
* | Update skip_after_callbacks_if_terminated documentationRafael Mendonça França2018-03-051-2/+2
| | | | | | | | | | Now we always have a terminator, so we don't need to day the options only make sense when the `:terminator` options is specified.
* | [ci skip] Fix grammar in delegate, private: true docs.Kasper Timm Hansen2018-03-041-5/+4
| | | | | | | | | | | | | | | | | | Convert the user to atheism by ditching the extra example that demonstrates the same thing as date_of_birth. Demonstrate the NoMethodError on date_of_birth first, then call age that uses date_of_birth internally. Thus showing that accessing it publicly fails, but using it internally succeeds.
* | Deprecate "active_support/core_ext/numeric/inquiry"bogdanvlviv2018-03-024-108/+5
| | | | | | | | | | | | Numeric#positive? and Numeric#negative? was added to Ruby since 2.3, see https://github.com/ruby/ruby/blob/ruby_2_3/NEWS Rails 6 requires Ruby 2.4.1+ since https://github.com/rails/rails/pull/32034
* | Deprecate `active_support/core_ext/hash/compact`yuuji.yaginuma2018-03-023-61/+6
| | | | | | | | | | Ruby 2.4+ provides `Hash#compact` and `Hash#compact!` natively, so `active_support/core_ext/hash/compact` is no longer necessary.
* | Remove unnecessary `respond_to?(:report_on_exception)` checkingyuuji.yaginuma2018-03-021-2/+2
| | | | | | | | Since Rails 6 requires Ruby 2.4.1+.
* | Ruby 2.4: take advantage of String#unpack1Jeremy Daer2018-03-012-5/+5
| | | | | | | | | | https://bugs.ruby-lang.org/issues/12752 https://ruby-doc.org/core-2.4.0/String.html#method-i-unpack1
* | Add separate test to ensure that `delegate` with `:private` option returns ↵bogdanvlviv2018-02-283-16/+23
| | | | | | | | | | | | | | | | correct value Remove extra comments `# Asking for private method` in activesupport/test/core_ext/module_test.rb Improve docs of using `delegate` with `:private` Update changelog of #31944
* | Remove extra changelog added by #31944bogdanvlviv2018-02-271-16/+0
| | | | | | | | | | | | Previously it was removed by #32106 since it was backported to `5-2-stable`. [ci skip]
* | add private: true option for ActiveSupport delegateTomas Valent2018-02-263-2/+117
| |
* | Remove changelogs for Rails 6.0 since they were backported to `5-2-stable`bogdanvlviv2018-02-261-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove railties' changelog added by 7340596de45dc4c0f62a287b6acc4e71d8ee6c60 since it was backported to `5-2-stable` via ac99916fcf7bf27bb1519d4f7387c6b4c5f0463d Remove activesupport's changelog added by 1077ae96b34b5a1dfbf10ee0c40b1ceb1eb6b30b since it was backported to `5-2-stable` via a2b97e4ffef971607a1be8fc7909f099b6840f36 Remove activesupport's changelog added by 0d41a76d0c693000005d79456dee7f9299f5e8d4 since it was backported to `5-2-stable` via cdce6a709e1cbc98fff009effc3b1b3ce4c7e8db Remove activestorage's changelog added by d57c52a385eb57c6ce8c6d124ab5e186f931d142 since it was backported to `5-2-stable` via 5292cdf59a2052c453d6016c69b90b790cbf2547 Follow up c113bdc9d0c2cffd535ca97aff85c4bdc46b11f6