aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #36329 from XrXr/no-doc-template-assertionsRafael França2019-05-221-1/+1
|\ | | | | Remove compatibility module from docs [ci skip]
| * Remove compatibility module from docs [ci skip]Alan Wu2019-05-221-1/+1
| | | | | | | | | | This module exists to warn old users. I think we should remove it from the docs so we don't advertise it.
* | Merge pull request #36294 from ↵Rafael França2019-05-224-0/+39
|\ \ | | | | | | | | | | | | gustavogr/add-deep-transform-keys-to-strong-params Added deep_transform_keys to StrongParameters
| * | Implemented deep_transform_keys/! for ActionController::ParametersGustavo Gutierrez2019-05-224-0/+39
|/ /
* | Add `action_cable_connection_test_case` hook to the "available hooks" list ↵प्रथमेश Sonpatki2019-05-221-28/+29
| | | | | | | | | | [ci skip] (#36326) - This hook was added in 90296674b1c
* | Merge pull request #36320 from XrXr/no-doc-prependRafael França2019-05-211-1/+1
|\ \ | | | | | | [CI skip] Put :nodoc: on method that raises NoMethodError
| * | Put :nodoc: on method that raises NoMethodErrorAlan Wu2019-05-211-1/+1
| | | | | | | | | | | | | | | This method is not intended to be used so I think we should remove it from the docs.
* | | Use `capture_sql` instead of `assert_sql` with no patternRyuta Kamizono2019-05-223-15/+12
| |/ |/| | | | | And no longer need to except SCHEMA SQLs manually since 0810c07.
* | Give up filling schema cache before `assert_no_queries`Ryuta Kamizono2019-05-226-90/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit a1ee4a9ff9d4a3cb255365310ead0dc7b739c6be. Even if a1ee4a9 is applied, CI is still flakiness. https://buildkite.com/rails/rails/builds/61252#2c090afa-aa84-4a2b-8b81-9f09219222c6/994-1005 https://buildkite.com/rails/rails/builds/61252#2e55bf83-1bde-44a2-a4f1-b5c3f6820fb4/929-938 Failing tests by whether schema cache is filled or not, it actually means that whether SCHEMA SQLs are executed or not is not target for the tests. So I've reverted commit a1ee4a9 which filling schema cache before `assert_no_queries`, and replace `assert_no_queries` to `assert_queries(0)`.
* | Put all `explain` methods into `DatabaseStatements` moduleRyuta Kamizono2019-05-224-18/+14
| | | | | | | | | | Almost all database statements methods except `explain` was moved into `DatabaseStatements` at #35922. This moves the last one method.
* | Merge pull request #36314 from kamipo/fallback_type_castingRyuta Kamizono2019-05-213-21/+28
|\ \ | | | | | | Fall back to type casting from the connection adapter
| * | Fall back to type casting from the connection adapterRyuta Kamizono2019-05-213-21/+28
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, a11a8ff had no effect as long as using bind param, and was not tested. This ensures making the intent of a11a8ff, which fall back to type casting from the connection adapter. Fixes #35205. ``` % ARCONN=postgresql bundle exec ruby -w -Itest test/cases/relation/where_test.rb -n test_type_casting_nested_joins Using postgresql Run options: -n test_type_casting_nested_joins --seed 55730 # Running: E Error: ActiveRecord::WhereTest#test_type_casting_nested_joins: ActiveRecord::StatementInvalid: PG::InvalidTextRepresentation: ERROR: invalid input syntax for integer: "2-foo" rails test test/cases/relation/where_test.rb:30 Finished in 0.245778s, 4.0687 runs/s, 0.0000 assertions/s. 1 runs, 0 assertions, 0 failures, 1 errors, 0 skips ```
* | Except SCHEMA SQLs in `capture_sql`Ryuta Kamizono2019-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Testing the result of `capture_sql` is fragile, it is due to whether SCHEMA SQLs are executed or not depends on whether schema cache is filled or not. https://buildkite.com/rails/rails/builds/61248#a5b9dc59-ff0c-40c0-b56e-0895662fbc4c/993-1004 https://buildkite.com/rails/rails/builds/61248#1157b389-f2c7-4554-b6e5-a37624a0e74a/996-1005 I've confirmed all `capture_sql` use cases in our code base, all cases won't expect SCHEMA SQLs are included. ``` % git grep -n capture_sql test/cases/associations/belongs_to_associations_test.rb:202: sql = capture_sql { comment.post } test/cases/associations/belongs_to_associations_test.rb:204: assert_not_equal sql, capture_sql { comment.post } test/cases/associations/has_many_associations_test.rb:169: sql = capture_sql { post.comments.to_a } test/cases/associations/has_many_associations_test.rb:171: assert_not_equal sql, capture_sql { post.comments.to_a } test/cases/associations/has_many_associations_test.rb:276: expected_sql = capture_sql { author.thinking_posts.delete_all } test/cases/associations/has_many_associations_test.rb:281: loaded_sql = capture_sql { author.thinking_posts.delete_all } test/cases/associations/has_many_associations_test.rb:289: expected_sql = capture_sql { author.posts.delete_all } test/cases/associations/has_many_associations_test.rb:294: loaded_sql = capture_sql { author.posts.delete_all } test/cases/associations/left_outer_join_association_test.rb:22: queries = capture_sql do test/cases/associations/left_outer_join_association_test.rb:49: queries = capture_sql { Author.left_outer_joins(:posts).to_a } test/cases/associations/left_outer_join_association_test.rb:54: queries = capture_sql { Author.joins(:posts).left_outer_joins(:posts).to_a } test/cases/associations/left_outer_join_association_test.rb:60: queries = capture_sql { Author.left_outer_joins({}).to_a } test/cases/associations/left_outer_join_association_test.rb:65: queries = capture_sql { Author.left_outer_joins([]).to_a } test/cases/associations/left_outer_join_association_test.rb:78: queries = capture_sql { Author.left_outer_joins(:essays).to_a } test/cases/associations_test.rb:384: log = capture_sql do test/cases/associations_test.rb:399: log = capture_sql do test/cases/associations_test.rb:414: log = capture_sql do test/cases/associations_test.rb:429: log = capture_sql do test/cases/associations_test.rb:444: log = capture_sql do test/cases/associations_test.rb:459: log = capture_sql do test/cases/reflection_test.rb:307: expected_sql = capture_sql { hotel.recipes.to_a } test/cases/reflection_test.rb:312: loaded_sql = capture_sql { hotel.recipes.to_a } test/cases/relation_test.rb:212: queries = capture_sql { Author.joins(:posts).merge(Post.joins(:comments)).to_a } test/cases/relation_test.rb:232: queries = capture_sql { Post.joins(:author, :categorizations).merge(Author.select(:id)).merge(categorizations_with_authors).to_a } test/cases/relation_test.rb:347: log = capture_sql do test/cases/scoping/relation_scoping_test.rb:146: log = capture_sql do test/cases/scoping/relation_scoping_test.rb:159: log = capture_sql do test/cases/test_case.rb:33: def capture_sql test/cases/test_case.rb:41: capture_sql { yield } ```
* | Correct test nameGeorge Claghorn2019-05-201-1/+1
| |
* | Merge pull request #36309 from alexandergraul/number_to_human_size_examplesRyuta Kamizono2019-05-212-2/+2
|\ \ | | | | | | Correct human file size examples [ci skip]
| * | Correct human file size examples [ci skip]Alexander Graul2019-05-202-2/+2
|/ / | | | | | | | | | | | | | | | | | | The `number_to_human_size` helpers in Action View and Active Support calculate the "human size" with a base of 1024. The examples should reflect that so they don't confuse the reader. The updated documentations use the values from: helper.number_to_human_size(1500)
* | Merge pull request #36306 from cseelus/responsive-rescues-layoutKasper Timm Hansen2019-05-201-4/+9
|\ \ | | | | | | Make rescues layout responsive
| * | Make rescues layout responsiveChris Seelus2019-05-201-4/+9
| | |
* | | Merge pull request #36302 from eugeneius/parameters_transform_keys_enumeratorRyuta Kamizono2019-05-203-9/+24
|\ \ \ | |/ / |/| | | | | Return parameters enumerator from transform_keys/!
| * | Return parameters enumerator from transform_keys/!Eugene Kenny2019-05-183-9/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously calling `ActionController::Parameters#transform_keys/!` without passing a block would return an enumerator for the underlying hash, which was inconsistent with the behaviour when a block was passed: ActionController::Parameters.new(foo: "bar").transform_keys { |k| k } => <ActionController::Parameters {"foo"=>"bar"} permitted: false> ActionController::Parameters.new(foo: "bar").transform_keys.each { |k| k } => {"foo"=>"bar"} An enumerator for the parameters is now returned instead, ensuring that evaluating it produces another parameters object instead of a hash: ActionController::Parameters.new(foo: "bar").transform_keys.each { |k| k } => <ActionController::Parameters {"foo"=>"bar"} permitted: false>
* | | Merge pull request #36304 from kamipo/fix_through_association_with_joinsRyuta Kamizono2019-05-192-17/+19
|\ \ \ | | | | | | | | Implicit through table joins should be appeared before user supplied joins
| * | | Implicit through table joins should be appeared before user supplied joinsRyuta Kamizono2019-05-192-17/+19
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #36293 was an issue for through association with `joins` for a long time, but since #35864 through association with `left_joins` would also be affected by the issue. Implicit through table joins should be appeared before user supplied joins, otherwise loading through association with joins will cause a statement invalid error. Fixes #36293. ``` % ARCONN=postgresql bundle exec ruby -w -Itest test/cases/associations/has_many_through_associations_test .rb -n test_through_association_with_joins Using postgresql Run options: -n test_through_association_with_joins --seed 7116 # Running: E Error: HasManyThroughAssociationsTest#test_through_association_with_joins: ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: missing FROM-clause entry for table "posts" LINE 1: ... "comments_posts" ON "comments_posts"."post_id" = "posts"."i... ^ : SELECT "comments".* FROM "comments" INNER JOIN "comments" "comments_posts" ON "comments_posts"."post_id" = "posts"."id" INNER JOIN "posts" ON "comments"."post_id" = "posts"."id" WHERE "posts"."author_id" = $1 rails test test/cases/associations/has_many_through_associations_test.rb:61 Finished in 0.388657s, 2.5730 runs/s, 0.0000 assertions/s. 1 runs, 0 assertions, 0 failures, 1 errors, 0 skips ```
* | | Allow filling in the only rich-text area without a locatorGeorge Claghorn2019-05-192-7/+17
| | |
* | | Prefer Capybara::Node::Element#execute_scriptGeorge Claghorn2019-05-191-4/+1
|/ /
* | Merge pull request #36122 from ↵Gannon McGibbon2019-05-182-0/+69
|\ \ | | | | | | | | | | | | cseelus/respect-operating-system-color-scheme-for-errors Regard operating system color scheme for rescues
| * | Implement dark color scheme for rescues layoutChris Seelus2019-05-182-0/+69
| | |
* | | Merge pull request #36299 from shioimm/rename-hash-to-jarRyuta Kamizono2019-05-181-2/+2
|\ \ \ | | | | | | | | Rename `hash` to `jar` in CookieJar.build
| * | | Rename `hash` to `jar` in CookieJar.buildshioimm2019-05-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In CookieJar.build, the name `hash` is used as block parameter name for tap method. However, it is actually not hash but a CookieJar's instance. The name `hash` was confusing, so replace with `jar`.
* | | | Merge pull request #36282 from yoones/add-skip-options-to-command-line-guideEileen M. Uchitelle2019-05-181-0/+22
|\ \ \ \ | | | | | | | | | | List available skip options in command line guide
| * | | | List available skip options in command line guide [ci skip]Younes SERRAJ2019-05-151-0/+22
| | |/ / | |/| |
* | | | Merge pull request #36263 from vishaltelangre/add-undefined-acronymEileen M. Uchitelle2019-05-181-2/+2
|\ \ \ \ | | | | | | | | | | [skip ci] Add undefined STI acronym to the heading which is referred under its section
| * | | | [skip ci] Add undefined STI acronym to the heading which is referred under ↵Vishal Telangre2019-05-121-2/+2
| | | | | | | | | | | | | | | | | | | | its section
* | | | | Merge pull request #36296 from jhawthorn/dont_fear_the_reaperAaron Patterson2019-05-181-7/+25
|\ \ \ \ \ | |_|_|/ / |/| | | | Use a single thread for all ConnectionPool Reapers
| * | | | Use a single thread for all ConnectionPool ReapersJohn Hawthorn2019-05-171-7/+25
| | | | | | | | | | | | | | | | | | | | | | | | | Previously we would spawn one thread per connection pool, which ends up being wasteful for apps with several connection pools.
* | | | | Deduplicate ActionText::RichText embedsGeorge Claghorn2019-05-172-1/+10
| | | | | | | | | | | | | | | | | | | | Fix that an ActiveRecord::RecordNotUnique error would be raised when saving rich-text content with the same file attached multiple times.
* | | | | Merge pull request #36291 from flocela/patch-1Rafael França2019-05-161-1/+1
|\ \ \ \ \ | | | | | | | | | | | | typo change
| * | | | | typo changeflocela2019-05-161-1/+1
|/ / / / / | | | | | | | | | | | | | | | In Adding More RESTful Actions, Adding Member Routes: I believe the word 'that' should be added to the sentence, 'Within the block of member routes, each route name specifies the HTTP verb will be recognized.' This results in 'Within the block of member routes, each route name specifies the HTTP verb that will be recognized.'
* | | | | S3: permit uploading files larger than 5 GBGeorge Claghorn2019-05-163-6/+69
| | | | | | | | | | | | | | | Use multipart uploads for files larger than 100 MB. Dynamically calculate part size based on total object size and maximum part count.
* | | | | Permit running jobs in system testsGeorge Claghorn2019-05-165-67/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Inherit from ActiveSupport::TestCase instead of ActionDispatch::IntegrationTest. Active Job automatically mixes its test helper into the latter, forcibly setting the test queue adapter before Capybara starts its app server. As a bonus, we no longer need to remove the parts of the ActionDispatch::IntegrationTest API we don’t want to expose.
* | | | | Merge pull request #36286 from vishaltelangre/dummy-erb-compiler-fixEileen M. Uchitelle2019-05-162-8/+19
|\ \ \ \ \ | | | | | | | | | | | | Fix: DummyCompiler embeds invalid YAML content
| * | | | | Fix: DummyCompiler embeds invalid YAML contentVishal Telangre2019-05-152-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes https://github.com/rails/rails/issues/36285. Follow up of https://github.com/rails/rails/pull/36237.
* | | | | | Remove outdated cross-origin redirection testsGeorge Claghorn2019-05-152-55/+0
| | | | | |
* | | | | | Inline anemic methodsGeorge Claghorn2019-05-151-10/+4
|/ / / / /
* | | | | Merge pull request #36284 from kamipo/fix_eager_loading_with_string_joinsRyuta Kamizono2019-05-153-2/+23
|\ \ \ \ \ | |_|_|/ / |/| | | | Fix eager loading associations with string joins not to raise NoMethodError
| * | | | Fix eager loading associations with string joins not to raise NoMethodErrorRyuta Kamizono2019-05-153-2/+23
| | | | | | | | | | | | | | | | | | | | Fixes #34456.
* | | | | edit tweaks to recent patch in configuring guide [ci skip]Xavier Noria2019-05-141-1/+2
| | | | |
* | | | | Merge pull request #36200 from ↵Xavier Noria2019-05-141-0/+6
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | soartec-lab/update_guide_configuring_add_autoloader Added guide for `config.autoloader` [skip ci]
| * | | | | Added guide for `config.autoloader` [skip ci]soartec-lab2019-05-071-0/+6
| | | | | |
* | | | | | shortens a comment [ci skip]Xavier Noria2019-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | To avoid word wrap in the rendered guide.
* | | | | | Merge pull request #36237 from eileencodes/fix-erb-in-database-yaml-againEileen M. Uchitelle2019-05-142-1/+22
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix database loading when ERB is single line ternary