aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Add ability to configure cache notifications infoEileen Uchitelle2018-06-122-7/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This may seem like an unnecessary refactoring but some apps want / need to configure the information passed to the query cache logger. In order to do that we can add a method here that can be easily overridden by the app itself, rather than hacking the query cache logger to include that information. To override apps can call ``` def cache_notifications_info super.merge(connected_host: "hostname") end ``` This will take what's already in the query cache logger and add `@something="yea"` to the object. At GitHub we use this to log the number of queries that are cached, the connection host and the connection url.
* | | | Merge pull request #33127 from searls/patch-1Matthew Draper2018-06-121-1/+1
|\ \ \ \ | |/ / / |/| | | Remove reference to session_store.rb initializer
| * | | Remove reference to session_store.rb initializerJustin Searls2018-06-121-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | Rails no longer generates this file, but Google is still packed with results suggesting it should exist, so that the doc still pointed me to it threw me off (had I deleted it or something?). Probably be better to be vague and prompt the user to stick it in a config file they own. #33124
* | | Merge pull request #33123 from siasmj/masterRyuta Kamizono2018-06-121-1/+1
|\ \ \ | | | | | | | | Add comma to example in guides/source/active_storage_overview.md [ci skip]
| * | | Add comma to example in guides/source/active_storage_overview.md [ci skip]Matt Sias2018-06-111-1/+1
|/ / /
* | | Merge pull request #33121 from bogdanvlviv/add-changelog-for-32956Ryuta Kamizono2018-06-122-1/+7
|\ \ \ | | | | | | | | Add changelog for #32956 [ci skip]
| * | | Add changelog for #32956 [ci skip]bogdanvlviv2018-06-122-1/+7
|/ / / | | | | | | | | | Add mention about default value of `config.active_model.i18n_full_message`.
* | | Merge pull request #33120 from bogdanvlviv/fix-active_model-errors-docsRyuta Kamizono2018-06-122-2/+2
|\ \ \ | | | | | | | | Fix active_model/errors docs [ci skip]
| * | | Fix active_model/errors docs [ci skip]bogdanvlviv2018-06-122-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix indentation. - Add a missing dot to the end of the sentence. Related to #32956
* | | | Merge pull request #33119 from utilum/project_names_are_not_codeXavier Noria2018-06-112-5/+5
|\ \ \ \ | | | | | | | | | | Remove backticks around proejct names
| * | | | Remove backticks around proejct namesutilum2018-06-112-5/+5
| | | | | | | | | | | | | | | | | | | | [ci skip]
* | | | | Merge pull request #33118 from ↵Rafael França2018-06-112-1/+10
|\ \ \ \ \ | |/ / / / |/| | | | | | | | | | | | | | dan-jensen/fix-eager-load-lockup-bug-in-development Fix bug with eager_load in development environment
| * | | | Fix bug with eager_load in development environmentDan Jensen2018-06-112-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Modifies the routes simulator to allow for empty RouteSets, which are created when secondary Engines are loaded.
* | | | | Merge pull request #33106 from marcandre/datecalcRafael Mendonça França2018-06-111-15/+12
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | Improve some DateAndTime calculations
| * | | | | Use fetch for better error handlingMarc-Andre Lafortune2018-06-091-2/+2
| | | | | |
| * | | | | Use same weekday correspondance as Date#wday.Marc-Andre Lafortune2018-06-091-13/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DeepCover revealed that most of these `wday != 0 ? wday - 1 : 6` were not entirely covered, i.e. the case of `wday == 0` was not tested: https://deep-cover.github.io/rails-cover/activesupport/activesupport/lib/active_support/core_ext/date_and_time/calculations.rb.html#L351 There's actually no valid reason to consider Sunday a special case, so this commit simply reajusts the values used for calculations.
* | | | | | Merge pull request #33092 from utilum/warnings_in_contribute_guideRafael França2018-06-111-6/+0
|\ \ \ \ \ \ | | | | | | | | | | | | | | Remove ineffective no-warnings flags from Contribute guide
| * | | | | | Remove ineffective no-warnings flags from Contribute guideutilum2018-06-081-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is not working. [ci skip]
* | | | | | | Merge pull request #32997 from utilum/dev_dep_guide_update_ast_requirementsRafael França2018-06-115-10/+39
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Dev-Dep guide: mention AST third party requirements
| * | | | | | | Update ffmpeg -> FFmpeg, mutools|mupdf -> muPDFutilum2018-06-084-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
| * | | | | | | Dev-Dep guide: mention AST third party requirementsutilum2018-06-082-5/+33
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid the likes of: ``` Error: ActiveStorage::RepresentationTest#test_representing_an_MP4_video: Errno::ENOENT: No such file or directory - ffmpeg test/models/representation_test.rb:27:in `block in <class:RepresentationTest>' ``` Also note additiona macOS requirements in ActiveStorage guide. [ci skip]
* | | | / / / Don't use `target=`Rafael Mendonça França2018-06-112-2/+2
| |_|_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | It mark the association as loaded and this can cause the object to be in an stale state.
* | | | | | Merge pull request #33114 from utilum/redundant_accessorsRafael França2018-06-111-2/+0
|\ \ \ \ \ \ | | | | | | | | | | | | | | Remove redundant accessors in AC test stub
| * | | | | | Remove redundant accessorsutilum2018-06-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | introduced in a0ea528b61.
* | | | | | | Use `-=` to change the update the collection on the associationRafael Mendonça França2018-06-112-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also mark the association as loaded given we changed it in memory and avoid the next access to the reader to make a query to the databse.
* | | | | | | Merge pull request #29939 from arthurchui/activerecord-delete-associations-loopRafael Mendonça França2018-06-111-1/+2
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | | | | | | | | Use hash lookup for deleting existing associations from `target`
| * | | | | | Use hash lookup for deleting existing associations from `target`Arthur Chui2017-07-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `Array#delete` searches for all occurrences in the `target` array. When performing `dependent: :destroy` in active_record/associations/collection_association, the loop becomes O(N^2). It is particularly slow when destroying large amount of associations (e.g. 10K records). Either `Hash` or `Set` can optimize the loop to O(N). `Hash` is slightly faster in this simple usage. ```ruby class Dummy; end num = 10_000 test1a = num.times.map { Dummy.new }; nil test1b = test1a.dup test2a = num.times.map { Dummy.new }; nil test2b = test2a.dup Benchmark.ips do |x| x.config(stats: :bootstrap, confidence: 95) x.report("hash") do hash = test1a.group_by { |r| r } test1b.select! { |r| !hash[r] } end x.report("array") do test2a.each { |r| test2b.delete(r) } end x.compare! end ``` ``` Calculating ------------------------------------- hash 11.000 i/100ms array 1.000 i/100ms ------------------------------------------------- hash 114.586 (±16.6%) i/s - 561.000 array 1.710k (±10.3%) i/s - 8.377k Comparison: array: 1710.4 i/s hash: 114.6 i/s - 14.93x slower ```
* | | | | | | Merge pull request #32956 from Shopify/i18n_activemodel_errors_full_messageRafael França2018-06-115-2/+135
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | | Allow to override the full_message error format
| * | | | | | Add global config for config.active_model.i18n_full_messageMartin Larochelle2018-06-055-1/+59
| | | | | | |
| * | | | | | Allow to override the full_message error formatMartin Larochelle2018-05-222-2/+77
| | | | | | |
* | | | | | | Merge pull request #33093 from rails/use-rack-to-dump-queryAaron Patterson2018-06-112-3/+11
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Use Rack to generate query information under test
| * | | | | | | Use Rack to generate query information under testAaron Patterson2018-06-082-3/+11
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `to_query` sorts parameters before encoding them. This causes a round tripping issue as noted here: https://github.com/rails/rails/issues/23997#issuecomment-328297933 https://github.com/rails/rails/issues/10529#issuecomment-328298109 https://github.com/rails/rails/pull/30558 Unfortunately, that method is being used to generate cache keys, so its results need to be stable: https://github.com/rails/rails/commit/10dec0e65e1f4d87f411b4361045eba86b121be9 However, the test harness is only using `to_query` to encode parameters before sending them to the controller so the "cache key" usecase doesn't apply here. This commit adds a test that demonstrates the round trip problems and changes the serialization strategy to use Rack for encoding the parameters rather than `to_query`.
* | | | | | | Fix alias confliction when joining same table on has many through with ↵Ryuta Kamizono2018-06-112-1/+5
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | left_joins This regression was caused by #30995 due to `Hash#fetch` won't invoke default proc. Just revert the change since #30995 is completely fixed by e9c1653. Fixes #33048.
* | | | | | :scissors:Ryuta Kamizono2018-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
* | | | | | Update `config.active_storage.variable_content_types` default value in ↵yuuji.yaginuma2018-06-101-1/+1
| |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | guides [ci skip] Follow up of 3915a47.
* | | | | Merge pull request #33078 from bogdanvlviv/add-remove-requireRyuta Kamizono2018-06-095-13/+5
|\ \ \ \ \ | | | | | | | | | | | | Add/Remove `require`
| * | | | | Add missing `require`bogdanvlviv2018-06-072-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `activesupport/test/logger_test.rb` requires `tmpdir`. `activesupport/test/multibyte_test_helpers.rb` requires `filutils`, `open-uri`, and `tmpdir`.
| * | | | | Remove unused `require`bogdanvlviv2018-06-073-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `activesupport/multibyte_normalization_conformance_test.rb` `fileutils`, `tmpdir`, and `open-uri` are unused since c245ca30f248367e07d5d831195b12c93a1e3137, c245ca30f248367e07d5d831195b12c93a1e3137, and 7d7c2d13ba896dd8b58fe91d2fe0c4fc588069ca in accordance. - `activesupport/test/multibyte_conformance_test.rb` `tmpdir`, and `open-uri` are unused since c245ca30f248367e07d5d831195b12c93a1e3137, and 7d7c2d13ba896dd8b58fe91d2fe0c4fc588069ca in accordance. Remove using of `fileutils` since c245ca30f248367e07d5d831195b12c93a1e3137. - `activesupport/test/multibyte_grapheme_break_conformance_test.rb` `fileutils`, `tmpdir`, and `open-uri` are unused since c245ca30f248367e07d5d831195b12c93a1e3137, c245ca30f248367e07d5d831195b12c93a1e3137, and 7d7c2d13ba896dd8b58fe91d2fe0c4fc588069ca in accordance.
* | | | | | Avoid Node.js v10.4.0 for nowyuuji.yaginuma2018-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If use Node.js v10.4.0, ujs's build will result in an error, so temporarily fix the version to v10.3.0. Ref: https://travis-ci.org/rails/rails/jobs/389960856
* | | | | | Merge pull request #33087 from bogdanvlviv/document-CompareWithRangeRafael França2018-06-081-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Add `ActiveSupport::CompareWithRange` to API docs
| * | | | | | Add `ActiveSupport::CompareWithRange` to API docsbogdanvlviv2018-06-071-1/+1
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since it is documented in the guides http://edgeguides.rubyonrails.org/active_support_core_extensions.html#include-questionmark-and-cover-questionmark we can add it to API docs http://edgeapi.rubyonrails.org too. [ci skip]
* | | | | | Merge pull request #33102 from bogdanvlviv/refactor-actioncable-testsRafael França2018-06-0818-45/+12
|\ \ \ \ \ \ | | | | | | | | | | | | | | Refactor actioncable's tests
| * | | | | | Include `ActiveSupport::Testing::MethodCallAssertions` to ↵bogdanvlviv2018-06-0813-36/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `ActionCable::TestCase` Remove all `include ActiveSupport::Testing::MethodCallAssertions` in actioncable's tests since we can do it only in `ActionCable::TestCase` in order to prevent code duplication. We use the same approach for other modules of Rails.
| * | | | | | Inherit all actioncable's test classes from `ActionCable::TestCase`bogdanvlviv2018-06-089-9/+9
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | We have defined `ActionCable::TestCase` in `actioncable/test/test_helper.rb` that we can use in order to prevent code duplication and build common interface for actioncable's test.
* | | | | | Merge pull request #33103 from bogdanvlviv/fix-using-of-method_call_assertionsRafael França2018-06-083-5/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | Remove extra `include ActiveSupport::Testing::MethodCallAssertions`
| * | | | | | Include `ActiveSupport::Testing::MethodCallAssertions` in ↵bogdanvlviv2018-06-092-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `railties/test/isolation/abstract_unit.rb` Related to #33102
| * | | | | | Remove extra `include ActiveSupport::Testing::MethodCallAssertions`bogdanvlviv2018-06-081-3/+0
| |/ / / / / | | | | | | | | | | | | | | | | | | It includes via `require "abstract_unit"`.
* | | | | | Merge pull request #27577 from maclover7/jm-fix-27547Rafael Mendonça França2018-06-082-8/+47
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | Action Cable owns database connection, not Active Record
| * | | | | Action Cable owns database connection, not Active RecordJon Moss2017-03-252-8/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, the database connection used in Action Cable's PostgreSQL adapter was "owned" by `ActiveRecord::Base.connection_pool`. This meant that if, for example, `#clear_reloadable_connections!` was called on the pool, Active Record would "steal" the database connection from Action Cable, and would cause all sorts of issues. This became evident during file reloads; despite Action Cable trying its hardest to return its borrowed database connection to Active Record via `@pubsub.shutdown`, Active Record calls `#clear_reloadable_connections!` on the connection pool, and due to the order of callbacks, Active Record's callback was being executed first. This meant that if you tried to rerender a view after a file was reloaded, you would have to wait through Active Record's timeout and such. Now, Action Cable takes direct ownership of the database connection it uses. It removes the connection from the pool to avoid the situation described above. Action Cable also makes sure to call `#disconnect!` on the connection when appropriate, to match the previous behavior of Active Record. [ Jon Moss & Matthew Draper]
* | | | | | Merge pull request #33089 from bogdanvlviv/refactor-attached_test.rbGeorge Claghorn2018-06-071-19/+21
|\ \ \ \ \ \ | | | | | | | | | | | | | | Refactor activestorage/test/models/attached_test.rb