- 03 1月, 2020 9 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Rafael França 提交于
Fix regression, enforce fresh ETag header after collection contents change
-
由 Aaron Lipman 提交于
Add ActiveRecord::Relation#cache_key_with_version. This method will be used by ActionController::ConditionalGet to ensure that when collection cache versioning is enabled, requests using ConditionalGet don't return the same ETag header after a collection is modified. Prior to the introduction of collection cache versioning in 4f2ac80d, all collection cache keys included a version. However, with cache versioning enabled, collection cache keys remain constant. In turn, ETag headers remain constant, rendering them ineffective. This commit takes the cache_key_with_version method used for individual Active Record objects (from aa8749eb), and adds it to collections.
-
由 Rafael França 提交于
Add `ActionDispatch::HostAuthorization` to "Configuring Middleware" guide [ci skip]
-
由 Rafael França 提交于
Add to the log format "*/*" if using a not found format:
-
由 Rafael França 提交于
Separate with space between table name and columns list in SQL of insert_all
-
由 Rafael França 提交于
Mime::Mimes#symbols should return a always up to date reference:
-
The rendering template is processing as */* but in the log is "Processing by Controller#action as " This change add the */* for the log and showing as "Processing by Controller#action as */*" when there not founds for the extension of format.
-
由 Edouard CHIN 提交于
- Original issue was reported in https://github.com/rails/rails/issues/38094 and a fix attempted in https://github.com/rails/rails/pull/38126 but it's not the proper fix I think. TL;DR Is that `ActionView::Base.default_formats` holds a copy of mime symbols at the time ActionView::Base is loaded. So if you try to register mime types after ActionView Base is loaded then it won't work. ```ruby ActionView::Base.default_formats ||= Mime::SET.symbols # Note that this is automatically done when ActionView get loaded https://github.com/rails/rails/blob/22483b86a6c779743b30e2f23bb46accfbf96b28/actionpack/lib/action_dispatch.rb#L117 Mime::Type.register_alias "application/xhtml+xml", :foobar puts ActionView::base.defaults_formats.include?(:foobar) # => false ``` Same issue if you try to unregister a mime after ActionView is loaded. That's what was happening in the flaky test: ``` Mime::Type.register_alias "application/xhtml+xml", :foobar ActionView::Base.default_formats ||= Mime::SET.symbols puts ActionView::base.defaults_formats.include?(:foobar) # => true Mime::Type.unregister(:foobar) puts ActionView::base.defaults_formats.include?(:foobar) # => true ``` ### Solution Return a refence to `@symbols` which is updated each time a new mime is registered/unregistered.
-
- 02 1月, 2020 8 次提交
-
-
由 bogdanvlviv 提交于
This commit copies info from https://github.com/rails/rails/pull/33145 ([an excellent changelog](https://github.com/rails/rails/blob/6-0-stable/railties/CHANGELOG.md)) to our guides. Closes https://github.com/rails/rails/issues/36959 Not sure whether there is a need mentioning `config.hosts` in the "Upgrading to Rails 6.0" guide since it is configured to work in the development environment by default and we guide how to deal with "blocked host" issue, see: https://github.com/rails/rails/blob/6-0-stable/actionpack/lib/action_dispatch/middleware/templates/rescues/blocked_host.html.erb I would like to backport this to `6-0-stable` so users will be able to find info about `ActionDispatch::HostAuthorization` middleware and how to configure it. Give credit to @gsamokovarov since I copied the info from the changelog. <3 [bogdanvlviv, Genadi Samokovarov]
-
由 Ryuta Kamizono 提交于
Closes #38132
-
由 Takafumi ONAKA 提交于
In arel, there is a space between the table name and columns list when INSERT. https://github.com/rails/rails/blob/3c28e79b615f6937f5abdc433ff634d15cf2466f/activerecord/lib/arel/visitors/to_sql.rb#L56 ```ruby User.create!(name: "foo") # INSERT INTO `users` (`name`) VALUES ('foo') ^^^^^^^^^^^^^^^^ ``` But SQL of insert_all is not separated. ```ruby User.insert_all!([{name: "foo"}]) # INSERT INTO `users`(`name`) VALUES ('foo') ^^^^^^^^^^^^^^^ ``` This is not a problem (because it is correct as SQL), but fixing this will make unified behavior. A known issue is that database_rewinder fails to parse table name on insert_all. https://github.com/amatsuda/database_rewinder/blob/v0.9.1/lib/database_rewinder.rb#L51-L54 ```ruby statement = "INSERT INTO `users`(`name`) VALUES ('foo')" match = statement.match(/\A\s*INSERT(?:\s+IGNORE)?(?:\s+INTO)?\s+(?:\.*[`"]?([^.\s`"]+)[`"]?)*/i) # => #<MatchData "INSERT INTO `users`(`name`)" 1:")"> # Expected behavior is # => #<MatchData "INSERT INTO `users`" 1:"users"> ```
-
由 Ryuta Kamizono 提交于
Use travel_to to in date_helper_test.rb.
-
由 Matthew Draper 提交于
Remove Travis CI files
-
由 Josef Šimánek 提交于
-
由 Yasuo Honda 提交于
Rails CI has been running at Buildkite for 9 month. Refer https://github.com/rails/rails/commit/e485c14a3ee29ee486324a96545abf964d428101
-
由 Yasuo Honda 提交于
Rather than replace `ENV['TRAVIS']` with `ENV['CI']`, I think we can remove this condition because `ENV['TRAVIS']` is not valid at Buildkite then Rails CI has been running with `PROCESS_COUNT` about 9 month since this https://github.com/rails/rails/commit/e485c14a3ee29ee486324a96545abf964d428101
-
- 01 1月, 2020 1 次提交
-
-
由 Abhay Nikam 提交于
-
- 31 12月, 2019 8 次提交
-
-
由 Carlos Antonio da Silva 提交于
-
由 Carlos Antonio da Silva 提交于
-
由 Carlos Antonio da Silva 提交于
-
由 Kasper Timm Hansen 提交于
Address StarStarMimeControllerTest#test_javascript_with_no_format_only_star_star failure
-
由 Kasper Timm Hansen 提交于
Add ActionCable subscription connection identifier to PostgreSQL adapter
-
由 Carlos Antonio da Silva 提交于
* The last html block wasn't formatting properly, it needed a blank line between the paragraph and the text. * The ordered list wasn't generating the sequence, but always showing 1., the inner content/examples needed to be indented for that to work. * Mark some pieces as inline code for highlighting. * Tweak a couple sentences.
-
由 Sergey Ponomarev 提交于
* You can distinguish connection among others with specific `application_name` ```sql SELECT application_name FROM pg_stat_activity; /* application_name ------------------------ psql ActionCable-PID-42 (2 rows) */ ``` * It's possible to customize connection identification with `id` option in `cable.yml` `ActionCable-PID-#{$$}` is the default value * Related tests refactoring * `ActionCable::Server#config.cable` is no mutated anymore inside Redis subscription adapter
-
由 Yasuo Honda 提交于
Fix #38094 * Steps to reproduce: ```ruby % cd actionpack % MT_CPU=0 bundle exec ruby -w -Itest test/controller/mime/accept_format_test.rb -n "/^(?:MimeControllerLayoutsTest#(?:test_missing_layout_renders_properly)|StarStarMimeControllerTest#(?:test_javascript_with_no_format_only_star_star))$/" --verbose --seed 15759 ``` * Actual result without this commit: ```ruby % cd actionpack % MT_CPU=0 bundle exec ruby -w -Itest test/controller/mime/accept_format_test.rb -n "/^(?:MimeControllerLayoutsTest#(?:test_missing_layout_renders_properly)|StarStarMimeControllerTest#(?:test_javascript_with_no_format_only_star_star))$/" --verbose --seed 15759 Run options: -n "/^(?:MimeControllerLayoutsTest#(?:test_missing_layout_renders_properly)|StarStarMimeControllerTest#(?:test_javascript_with_no_format_only_star_star))$/" --verbose --seed 15759 MimeControllerLayoutsTest#test_missing_layout_renders_properly = 0.18 s = . StarStarMimeControllerTest#test_javascript_with_no_format_only_star_star = 0.00 s = E Error: StarStarMimeControllerTest#test_javascript_with_no_format_only_star_star: ArgumentError: Invalid formats: :iphone /Users/yahonda/src/github.com/yahonda/rails/actionview/lib/action_view/lookup_context.rb:287:in `formats=' /Users/yahonda/src/github.com/yahonda/rails/actionview/lib/action_view/view_paths.rb:11:in `formats=' /Users/yahonda/src/github.com/yahonda/rails/actionpack/lib/action_controller/metal/rendering.rb:29:in `process_action' /Users/yahonda/src/github.com/yahonda/rails/actionpack/lib/abstract_controller/callbacks.rb:42:in `block in process_action' /Users/yahonda/src/github.com/yahonda/rails/activesupport/lib/active_support/callbacks.rb:98:in `run_callbacks' /Users/yahonda/src/github.com/yahonda/rails/actionpack/lib/abstract_controller/callbacks.rb:41:in `process_action' /Users/yahonda/src/github.com/yahonda/rails/actionpack/lib/action_controller/metal/rescue.rb:22:in `process_action' /Users/yahonda/src/github.com/yahonda/rails/actionpack/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action' /Users/yahonda/src/github.com/yahonda/rails/activesupport/lib/active_support/notifications.rb:203:in `block in instrument' /Users/yahonda/src/github.com/yahonda/rails/activesupport/lib/active_support/notifications/instrumenter.rb:24:in `instrument' /Users/yahonda/src/github.com/yahonda/rails/activesupport/lib/active_support/notifications.rb:203:in `instrument' /Users/yahonda/src/github.com/yahonda/rails/actionpack/lib/action_controller/metal/instrumentation.rb:33:in `process_action' /Users/yahonda/src/github.com/yahonda/rails/actionpack/lib/action_controller/metal/params_wrapper.rb:245:in `process_action' /Users/yahonda/src/github.com/yahonda/rails/actionpack/lib/abstract_controller/base.rb:136:in `process' /Users/yahonda/src/github.com/yahonda/rails/actionview/lib/action_view/rendering.rb:39:in `process' /Users/yahonda/src/github.com/yahonda/rails/actionpack/lib/action_controller/metal.rb:190:in `dispatch' /Users/yahonda/src/github.com/yahonda/rails/actionpack/lib/action_controller/test_case.rb:512:in `process' /Users/yahonda/src/github.com/yahonda/rails/actionpack/lib/action_controller/test_case.rb:390:in `get' test/controller/mime/accept_format_test.rb:28:in `test_javascript_with_no_format_only_star_star' rails test test/controller/mime/accept_format_test.rb:26 Finished in 0.180610s, 11.0736 runs/s, 11.0736 assertions/s. 2 runs, 2 assertions, 0 failures, 1 errors, 0 skips % ``` * How to diagnose this error: At first Restore `require "action_view/base"` to `actionpack/lib/action_dispatch/middleware/debug_exceptions.rb` addresses this error, then isolated which lines are required then found this line is required. https://github.com/rails/rails/blob/22483b86a6c779743b30e2f23bb46accfbf96b28/actionpack/lib/action_dispatch.rb#L117 ```ruby ActionView::Base.default_formats ||= Mime::SET.symbols ```
-
- 30 12月, 2019 2 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Kasper Timm Hansen 提交于
Set AJ `return_false_on_aborted_enqueue` true in the test suite:
-
- 29 12月, 2019 6 次提交
-
-
由 Rafael França 提交于
Return unfrozen strings from to_sentence
-
由 Rafael França 提交于
Do not abort `rails new` when git binary doesn't exist
-
由 Martijn Storck 提交于
Co-Authored-By: NEugene Kenny <elkenny@gmail.com>
-
由 Akira Matsuda 提交于
for `line.from`
-
由 Nicolas Dular 提交于
-
由 Ryuta Kamizono 提交于
-
- 28 12月, 2019 6 次提交
-
-
由 Edouard CHIN 提交于
- Since this is going to be the default in 6.1, let's set it in the test suite to avoid deprecation warning. Otherwise one has to do `AS::Deprecation.silence { }` everytime we add a new test. Fix #38107
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
I misunderstood the effect of `ruby2_keywords`, the effect is not local scope, the effect still alive even where you delegate.
-
由 Ryuta Kamizono 提交于
Address `DEPRECATED: use MT_CPU instead of N for parallel test runs`
-
由 Yasuo Honda 提交于
* Steps to reproduce ```ruby % cd actionpack % N=0 bundle exec ruby -w -Itest test/controller/mime/accept_format_test.rb DEPRECATED: use MT_CPU instead of N for parallel test runs ... snip ... % ``` * minitest 5.12.0 deprecates ENV["N"] to specify number of parallel test runners: https://github.com/seattlerb/minitest/blob/master/History.rdoc#5120--2019-09-22 https://github.com/seattlerb/minitest/commit/4103a10eb4bb99bc60721b3245ee3a69988a214b * No other code uses `ENV["N"]` ``` % git grep 'ENV\["N"\]' actionpack/test/abstract_unit.rb: PROCESS_COUNT = (ENV["N"] || 4).to_i % ``` * Rails guide suggests using `PARALLEL_WORKERS` to specify the number of workers, not `N` https://guides.rubyonrails.org/testing.html#parallel-testing https://guides.rubyonrails.org/testing.html#parallel-testing ```ruby PARALLEL_WORKERS=15 rails test ```
-
由 Rafael Mendonça França 提交于
-