aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #32681 from bdewater/rubocop-0-54Ryuta Kamizono2018-04-221-1/+1
|\ | | | | Rubocop 0.54
| * Fix Style/RedundantReturn offensesBart de Water2018-04-211-1/+1
| |
* | Fix typo in constant name [ci skip]yuuji.yaginuma2018-04-221-1/+1
|/
* Merge pull request #32642 from bogdanvlviv/fix-name-test-added-by-32613Andrew White2018-04-201-1/+1
|\ | | | | Fix name of the test added by #32613
| * Fix name of the test added by #32613bogdanvlviv2018-04-191-1/+1
| |
* | Return back "/" to the end of RAILS_GEM_ROOTbogdanvlviv2018-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | - The "/" was removed in 40bdbce191ad90dfea43dad51fac5c4726b89392 during refactoring. It may cause regression since looks like was added intentionaly because it is possible that a name of any another gem can start with /rails/, so slash was added to ensure that it is "rails" gem. I would like to backport this to `5-2-stable` too. - Use `__dir__` instead of `__FILE__`. Follow up #29176.
* | Merge pull request #32648 from ↵Rafael França2018-04-195-11/+11
|\ \ | | | | | | | | | | | | bogdanvlviv/improve-pattern-filenames-to-catch-more-style-offences Allow rubocop check more files
| * | Allow rubocop check more filesbogdanvlviv2018-04-195-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fix pattern of filenames for `CustomCops/AssertNot` and `CustomCops/RefuteNot`. rubocop should check every file under `test/`. Related to #32441, #32605
* | | Merge pull request #32168 from christianblais/activesupport-ordinalize-i18nRafael França2018-04-194-13/+59
|\ \ \ | |/ / |/| | `#ordinal` and `#ordinalize` now support I18n
| * | `ActiveSupport::Inflector#ordinal` and `ActiveSupport::Inflector#ordinalize`Christian Blais2018-03-054-13/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now support translations through I18n. { fr: { number: { nth: { ordinals: lambda do |_key, number:, **_options| if number.to_i.abs == 1 'er' else 'e' end end, ordinalized: lambda do |_key, number:, **_options| "#{number}#{ActiveSupport::Inflector.ordinal(number)}" end } } } }
* | | Merge pull request #32605 from composerinteralia/assert-notRafael França2018-04-1926-88/+88
|\ \ \ | |_|/ |/| | Add RuboCop for `assert_not` over `assert !`
| * | Replace `assert !` with `assert_not`Daniel Colson2018-04-1926-88/+88
| | | | | | | | | | | | | | | This autocorrects the violations after adding a custom cop in 3305c78dcd.
* | | Merge branch 'master' into fix-as-timezone-allAndrew White2018-04-192-6/+18
|\| |
| * | Redis cache store: avoid blocking the server in `#delete_matched`Gleb Mazovetskiy2018-04-182-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #32610. Closes #32614. Lua scripts in redis are *blocking*, meaning that no other client can execute any commands while the script is running. See https://redis.io/commands/eval#atomicity-of-scripts. This results in the following exceptions once the number of keys is sufficiently large: BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE. This commit replaces the lua-based implementation with one that uses `SCAN` and `DEL` in batches. This doesn't block the server. The primary limitation of `SCAN`, i.e. potential duplicate keys, is of no consequence here, because `DEL` ignores keys that do not exist.
* | | Fix exception in AS::Timezone.all when any tzinfo data is missingDominik Sander2018-04-184-1/+35
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change missing timezone data for any of the time zones defined in `ActiveSupport::Timezone::MAPPING` caused a `comparison of NilClass with ActiveSupport::TimeZone failed` exception. Attempting to get a timezone by passing a number/duration to `[]` or calling `all` directly will try to sort sort the values of `zones_map`. Those values are initialized by the return value of `create(zonename)` which returns `nil` if `TZInfo` is unable to find the timezone information. In our case the exception was triggered by an outdated tzdata package which did not include information for the "recently" added time zones. Before 078421bacba178eac6a8e607b16f3f4511c5d72f `zones_map` only returned the information that have been loaded into `@lazy_zone_map` which ignored time zones for which the data could not be loaded, this change restores the previous behaviour.
* | Merge pull request #32556 from utilum/splatRyuta Kamizono2018-04-171-2/+2
|\ \ | | | | | | 2.6 warning: passing splat keyword arguments as a single Hash
| * | 2.6 warning: passing splat keyword arguments as a single Hashutilum2018-04-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ruby 2.6.0 warns about this. ``` ruby -v ruby 2.6.0dev (2018-04-04 trunk 63085) [x86_64-linux] ``` Before, see: https://travis-ci.org/rails/rails/jobs/365740163#L1262-L1264 https://travis-ci.org/rails/rails/jobs/365944863#L2121-L2174
* | | Inclusive Language in Documentation Examples [ci skip]Cassidy Kobewka2018-04-151-2/+2
|/ /
* | Fix redis store clear keys outside the namespaceRei2018-04-152-1/+19
| | | | | | | | | | | | | | | | | | | | Namespace not working in RedisCacheStore#clear method. Bacause namespace = merged_options(options)[namespace] is always nil, Correct is namespace = merged_options(options)[:namespace]
* | 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
|/ / / / /