aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Remove `ignore_none: false` to assert no queries more strictlyRyuta Kamizono2018-10-057-31/+31
| | | | Follow up 811be477786455d144819a5e9fbb7f9f54b8da69.
* Use `assert_no_queries` not to ignore BEGIN/COMMIT queriesRyuta Kamizono2018-10-0513-38/+37
| | | | | | | | | `test_update_does_not_run_sql_if_record_has_not_changed` would pass without #18501 since `assert_queries` ignores BEGIN/COMMIT unless `ignore_none: true` is given. Since #32647, empty BEGIN/COMMIT is ommited. So we no longer need to use `assert_queries(0)` to ignore BEGIN/COMMIT in the queries.
* Simplify the condition in `prepare_update_statement`Ryuta Kamizono2018-10-051-8/+2
|
* Merge pull request #34064 from ↵Richard Schneeman2018-10-0410-81/+36
|\ | | | | | | | | schneems/schneems/revert-7f870a5ba2aa9177aa4a0e03a9d027928ba60e49 Revert "Merge pull request #33970 from rails/eager-url-helpers"
| * Revert "Merge pull request #33970 from rails/eager-url-helpers"schneems2018-10-0310-81/+36
| | | | | | | | | | | | | | Until #34050 can be resolved This reverts commit 7f870a5ba2aa9177aa4a0e03a9d027928ba60e49, reversing changes made to 6556898884d636c59baae008e42783b8d3e16440.
* | Restore `preloaders_for_one` methodRyuta Kamizono2018-10-051-5/+9
| | | | | | | | Since the above comment is for the `preloaders_for_one`.
* | failing test for eager loadingMatt Jones2018-10-041-0/+5
| | | | | | | | cherry-picked from https://github.com/rails/rails/pull/33763
* | Merge pull request #33938 from faucct/bugfix/preload_through_no_recordsEileen M. Uchitelle2018-10-042-28/+29
|\ \ | | | | | | ActiveRecord::Associations::Preloader should not fail to preload through missing records
| * | ActiveRecord::Associations::Preloader should not fail to preload through ↵Nikita Sokolov2018-10-022-28/+29
| | | | | | | | | | | | missing records
* | | Merge pull request #34073 from aidanharan/activerecord-regex-escape-table-nameRyuta Kamizono2018-10-041-1/+1
|\ \ \ | | | | | | | | Escape table name so that it can be used in regular expression
| * | | Escape table name so that it can be used in regular expressionAidan Haran2018-10-041-1/+1
|/ / /
* | | Merge pull request #34066 from eugeneius/remove_database_warningRyuta Kamizono2018-10-041-15/+1
|\ \ \ | | | | | | | | Remove unreachable database warning
| * | | Remove unreachable database warningEugene Kenny2018-10-041-15/+1
| | | | | | | | | | | | | | | | | | | | `establish_connection` will never raise `ActiveRecord::NoDatabaseError`, because it doesn't connect to a database; it sets up a connection pool.
* | | | Merge pull request #33936 from schneems/schneems/cache-micro-optimizationsRichard Schneeman2018-10-041-2/+6
|\ \ \ \ | |/ / / |/| | | Decrease memory allocations in cache.rb
| * | | Decrease memory allocations in cache.rbschneems2018-09-211-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `merged_options` method is private and the output is never mutated. Using this info we can get rid of the `dup` behavior. We can also eliminate the `merge` call in the case where all the options being merged are the same. Returned results are frozen as an extra layer of protection against mutation. Before ``` Total allocated: 741749 bytes (6642 objects) ``` After ``` Total allocated: 734039 bytes (6648 objects) ``` Diff ``` (741749 - 734039) / 741749.0 => ~ 1.0 % ``` If you don't feel comfortable modifying this method, we could rename it and only use it internally.
* | | | Don't use deprecated `LoggerSilence`yuuji.yaginuma2018-10-041-1/+1
| |_|/ |/| |
* | | Merge pull request #34055 from Edouard-chin/ec-logger-fixRafael França2018-10-036-22/+65
|\ \ \ | | | | | | | | Fix the LoggerSilence to work as described:
| * | | Fix the LoggerSilence to work as described:Edouard CHIN2018-10-026-22/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Following the Rails guide which state that a logger needs to include the `ActiveSupport::LoggerSilence` as well as `ActiveSupport::LoggerThreadSafe` modules isn't enough and won't work. Here is a test cases with 3 tests that all fails https://gist.github.com/Edouard-chin/4a72930c2b1eafbbd72a80c66f102010 The problems are the following: 1) The logger needs to call `after_initialize` in order to setup some instance variables. 2) The silence doesn't actually work because the bare ruby Logger `add` method checks for the instance variable `@logger`. We need to override the `add` (like we used to in the ActiveSupport::Logger class). 3) Calling `debug?` `info?` etc... doesn't work as the bare ruby methods will check for the instance variable. Again we need to override this methods (like we used to in the ActiveSupport::Logger class) The LoggerSilence won't work without LoggerThreadSafe, but the later is not public API, the user shouldn't have to include it so I modified to include it automatically. Same for the `after_initialize` method. I find unuintitive to have to call it directly. I modified to instance the variables when the module get included.
* | | | Merge pull request #34063 from bogdanvlviv/fix-rubocop-offense-b707a6d0eb7Rafael França2018-10-031-1/+1
|\ \ \ \ | | | | | | | | | | Fix rubocop issue
| * | | | Fix rubocop issuebogdanvlviv2018-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: `Layout/TrailingWhitespace: Trailing whitespace detected. See https://codeclimate.com/github/rails/rails/issues Releted to b707a6d0eb7
* | | | | Merge pull request #34061 from gmcgibbon/fixtures_refactor_fileEileen M. Uchitelle2018-10-033-214/+220
|\ \ \ \ \ | |/ / / / |/| | | | Move test_fixtures and render_context to separate files
| * | | | Move test_fixtures and render_context to separate filesGannon McGibbon2018-10-033-214/+220
|/ / / /
* | | | Fix the docs for Module#parents and related methods in guides [ci skip]Prathamesh Sonpatki2018-10-031-16/+16
| | | | | | | | | | | | | | | | - Followup of https://github.com/rails/rails/pull/34051
* | | | Bring config_accessor's API document back to its lifeAkira Matsuda2018-10-031-1/+1
| | | | | | | | | | | | | | | | the document has been disappeared since the method became private at c2bfe6cbc8cab9caeab418472a1e12a3ed3e75e2
* | | | :warning: assigned but unused variable - loggerAkira Matsuda2018-10-031-1/+1
| | | |
* | | | Move UPDATE/DELETE with JOIN handling to the Arel sideRyuta Kamizono2018-10-035-106/+92
|/ / /
* | | Merge pull request #34051 from gmcgibbon/module_parent_method_renameRafael Mendonça França2018-10-0210-36/+83
|\ \ \ | | | | | | | | | | | | Prefix Module#parent, Module#parents, and Module#parent_name with module
| * | | Fix call sitesGannon McGibbon2018-10-027-12/+12
| | | |
| * | | Prefix Module#parent, Module#parents, and Module#parent_name with moduleGannon McGibbon2018-10-023-24/+71
| | | |
* | | | Merge pull request #34053 from prathamesh-sonpatki/update-js-docsRafael França2018-10-025-17/+5
|\ \ \ \ | | | | | | | | | | Update js docs after the webpacker changes
| * | | | Turbolinks is enabled by default in new apps [ci skip]Prathamesh Sonpatki2018-10-031-4/+0
| | | | |
| * | | | Update the docs now that webpacker is default [ci skip]Prathamesh Sonpatki2018-10-034-13/+5
| |/ / /
* | | | Merge pull request #34045 from Edouard-chin/ec-logger-silence-namespaceRafael França2018-10-024-14/+41
|\ \ \ \ | |/ / / |/| | | Deprecate the `LoggerSilence` constant:
| * | | Deprecate the `LoggerSilence` constant:Edouard CHIN2018-10-024-14/+41
|/ / / | | | | | | | | | | | | | | | | | | | | | - I found this weird that the LoggerSilence wasn't using the `ActiveSupport` namespace (AFAIK all other classes have it). This PR deprecate the use of `LoggerSilence` for `ActiveSupport::LoggerSilence` instead.
* | | Merge pull request #33058 from gmcgibbon/string_first_last_negative_deprecationRafael França2018-10-023-0/+30
|\ \ \ | | | | | | | | Add deprecation warning when String#first and String#last receive neg…
| * | | Add deprecation warning when String#first and String#last receive negative ↵Gannon McGibbon2018-09-283-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | integers [Gannon McGibbon + Eric Turner]
* | | | Merge pull request #34049 from sharang-d/marshalling-text-changesRyuta Kamizono2018-10-028-28/+28
|\ \ \ \ | |_|_|/ |/| | | Fix spellings for 'unmarshall(ing/ed)' & 'marshall(ing/ed)'
| * | | Fix spellings for 'unmarshall(ing/ed)' & 'marshall(ing/ed)'Sharang Dashputre2018-10-028-28/+28
|/ / /
* | | Merge pull request #34046 from rtlechow/fix-typosYuji Yaginuma2018-10-022-3/+3
|\ \ \ | | | | | | | | Fix typos
| * | | Fix typosR.T. Lechow2018-10-012-3/+3
| | | | | | | | | | | | | | | | Fixes some typos.
* | | | Remove unnecessary `coffee-rails`yuuji.yaginuma2018-10-022-5/+0
|/ / / | | | | | | | | | | | | Since we no longer use coffeescript in the generated files by 4838c1716a0340137d858fab49bf460e23be5a4b, this is no longer necessary.
* | | Remove duplicated before_install entries in .travis.ymlRyuta Kamizono2018-10-011-3/+0
| | | | | | | | | | | | | | | | | | It has incorrectly been re-added at #33079. Related #33861.
* | | Make Webpacker the default JavaScript compiler for Rails 6 (#33079)David Heinemeier Hansson2018-09-3049-327/+285
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use Webpacker by default on new apps * Stop including coffee-rails by default * Drop using a js_compressor by default * Drop extra test for coffeescript inclusion by default * Stick with skip_javascript to signify skipping webpack * Don't install a JS runtime by default any more * app/javascript will be the new default directory for JS * Make it clear that this is just for configuring the default Webpack framework setup now * Start using the Webpack tag in the default layout * Irrelevant test * jQuery is long gone * Stop having asset pipeline compile default application.js * Add rails-ujs by default to the Webpack setup * Add Active Storage JavaScript to application.js pack by default * Consistent quoting * Add Turbolinks to default pack * Add Action Cable to default pack Need some work on how to set the global consumer that channels will work with. @javan? * Require all channels by default and use a separate consumer stub * Channel generator now targets Webpack style * Update task docs to match new generator style * Use uniform import style * Drop the JS assets generator It was barely helpful as it was. It’s no longer helpful in a Webpacked world. Sayonara! * Add app/javascript to the stats directories * Simpler import style Which match the other imports. * Address test failures from dropping JS compilation (and compression) * webpacker-default: Modify `AssetsGeneratorTest` Before: ``` $ bin/test test/generators/assets_generator_test.rb Run options: --seed 46201 F Failure: AssetsGeneratorTest#test_assets [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/assets_generator_test.rb:12]: Expected file "app/assets/javascripts/posts.js" to exist, but does not bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/assets_generator_test.rb:10 . Finished in 0.031343s, 63.8101 runs/s, 95.7152 assertions/s. 2 runs, 3 assertions, 1 failures, 0 errors, 0 skips ``` After: ``` $ bin/test test/generators/assets_generator_test.rb Run options: --seed 43571 .. Finished in 0.030370s, 65.8545 runs/s, 65.8545 assertions/s. 2 runs, 2 assertions, 0 failures, 0 errors, 0 skips ``` * webpacker-default: Modify `ChannelGeneratorTest` Before: ``` $ bin/test test/generators/channel_generator_test.rb Run options: --seed 8986 .F Failure: ChannelGeneratorTest#test_channel_with_multiple_actions_is_created [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:43]: Expected file "app/assets/javascripts/channels/chat.js" to exist, but does not bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:34 .F Failure: ChannelGeneratorTest#test_channel_is_created [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:29]: Expected file "app/assets/javascripts/channels/chat.js" to exist, but does not bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:22 E Error: ChannelGeneratorTest#test_cable_js_is_created_if_not_present_already: Errno::ENOENT: No such file or directory @ apply2files - /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/fixtures/tmp/app/assets/javascripts/cable.js bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:60 F Failure: ChannelGeneratorTest#test_channel_suffix_is_not_duplicated [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:87]: Expected file "app/assets/javascripts/channels/chat.js" to exist, but does not bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:80 F Failure: ChannelGeneratorTest#test_channel_on_revoke [/Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:77]: Expected file "app/assets/javascripts/cable.js" to exist, but does not bin/test /Users/ttanimichi/ghq/github.com/ttanimichi/rails/railties/test/generators/channel_generator_test.rb:68 Finished in 0.064384s, 108.7227 runs/s, 481.4861 assertions/s. 7 runs, 31 assertions, 4 failures, 1 errors, 0 skips ``` After: ``` $ bin/test test/generators/channel_generator_test.rb Run options: --seed 44857 ....... Finished in 0.060243s, 116.1961 runs/s, 697.1764 assertions/s. 7 runs, 42 assertions, 0 failures, 0 errors, 0 skips ``` * Fix shared generator tests. * webpacker-default: Modify `ControllerGeneratorTest` The JS assets generator was dropped. ref. https://github.com/rails/rails/commit/46215b179483d3e4d264555f5a4952f43eb8142a * Revert "Simpler import style". It's currently failing with an error of "TypeError: undefined is not an object (evaluating '__WEBPACK_IMPORTED_MODULE_2_activestorage___default.a.start')". Waiting for @javan to have a look. This reverts commit 5d3ebb71059f635d3756cbda4ab9752027e09256. * require webpacker in test app * Add webpacker without making the build hang/timeout. (#33640) * use yarn workspaces to allow for installing unreleased packages and only generate js/bootsnap when required * no longer need to have webpacker in env templates as webpacker moved this config to yml file * Fix rubocop violation * Got the test passing for the running scaffold * update expected lines of code * update middleware tests to account for webpacker * disable js in plugins be default to get the tests passing (#34009) * clear codeclimate report issues * Anything newer than currently released is good * Use Webpacker development version during development of Rails * Edge should get development webpacker as well * Add changelog entry for Webpacker change
* | | Handle UPDATE/DELETE with OFFSET in ArelRyuta Kamizono2018-10-016-19/+35
| | |
* | | Merge pull request #23593 from meinac/add_index_option_for_change_tableRyuta Kamizono2018-10-013-0/+22
|\ \ \ | | | | | | | | | | | | index option added for change_table migrations
| * | | Index option added for change_table migrationsMehmet Emin INAC2018-09-223-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case if we want to add a column into the existing table with index on it, we have to add column and index in two seperate lines. With this feature we don't need to write an extra line to add index for column. We can just use `index` option. Old behaviour in action: ``` change_table(:languages) do |t| t.string :country_code t.index: :country_code end ``` New behaviour in action: ``` change_table(:languages) do |t| t.string :country_code, index: true end ``` Exactly same behaviour is already exist for `create_table` migrations.
* | | | Merge pull request #33256 from ilkkao/ilkkao/remove-unused-params-optionRyuta Kamizono2018-10-013-5/+5
|\ \ \ \ | | | | | | | | | | | | | | | Don't handle params option in a special way in url_for helper
| * | | | Don't handle params option in a special way in url_for helperIlkka Oksanen2018-08-203-5/+5
| | | | |
* | | | | Merge pull request #32031 from yahonda/remove_redundant_freezeRyuta Kamizono2018-10-01109-268/+274
|\ \ \ \ \ | | | | | | | | | | | | Add `Style/RedundantFreeze` to remove redudant `.freeze`
| * | | | | Add `Style/RedundantFreeze` to remove redudant `.freeze`Yasuo Honda2018-09-29109-268/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Rails 6.0 will support Ruby 2.4.1 or higher `# frozen_string_literal: true` magic comment is enough to make string object frozen. This magic comment is enabled by `Style/FrozenStringLiteralComment` cop. * Exclude these files not to auto correct false positive `Regexp#freeze` - 'actionpack/lib/action_dispatch/journey/router/utils.rb' - 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb' It has been fixed by https://github.com/rubocop-hq/rubocop/pull/6333 Once the newer version of RuboCop released and available at Code Climate these exclude entries should be removed. * Replace `String#freeze` with `String#-@` manually if explicit frozen string objects are required - 'actionpack/test/controller/test_case_test.rb' - 'activemodel/test/cases/type/string_test.rb' - 'activesupport/lib/active_support/core_ext/string/strip.rb' - 'activesupport/test/core_ext/string_ext_test.rb' - 'railties/test/generators/actions_test.rb'