aboutsummaryrefslogtreecommitdiffstats
path: root/railties
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Add multi-db support to schema cache dump and clearGannon McGibbon2018-11-071-0/+31
| | | | | | | | | | | | | | | Adds support for multiple databases to `rails db:schema:cache:dump` and `rails db:schema:cache:clear`.
* | | Merge pull request #34387 from yhirano55/rails_info_properties_jsonRyuta Kamizono2018-11-075-2/+37
|\ \ \ | | | | | | | | Respond /rails/info/properties.json
| * | | Add JSON support to rails properties route (`/rails/info/properties`).Yoshiyuki Hirano2018-11-075-2/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added json format, like this: { "Rails version": "6.0.0.alpha", "Ruby version": "2.5.1-p57 (x86_64-darwin17)", "RubyGems version": "2.7.6", "Rack version": "2.0.6", "JavaScript Runtime": "Node.js (V8)", "Middleware": ["Rack::Sendfile", "ActionDispatch::Static", "ActionDispatch::Executor", "ActiveSupport::Cache::Strategy::LocalCache::Middleware", "Rack::Runtime", "Rack::MethodOverride", "ActionDispatch::RequestId", "ActionDispatch::RemoteIp", "Sprockets::Rails::QuietAssets", "Rails::Rack::Logger", "ActionDispatch::ShowExceptions", "WebConsole::Middleware", "ActionDispatch::DebugExceptions", "ActionDispatch::Reloader", "ActionDispatch::Callbacks", "ActiveRecord::Migration::CheckPending", "ActionDispatch::Cookies", "ActionDispatch::Session::CookieStore", "ActionDispatch::Flash", "ActionDispatch::ContentSecurityPolicy::Middleware", "Rack::Head", "Rack::ConditionalGet", "Rack::ETag", "Rack::TempfileReaper"], "Application root": "/path/to/app", "Environment": "development", "Database adapter": "sqlite3", "Database schema version": 0 }
* | | | Merge pull request #34392 from gmcgibbon/gem_security_note_amendRafael França2018-11-061-3/+3
|\ \ \ \ | | | | | | | | | | Amend CVE note and security guide section wordings
| * | | | Amend CVE note and security guide section wordingsGannon McGibbon2018-11-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reword first sentence of dep management and CVE section of security guide. Also, reword and move gemspec notes above deps. [ci skip]
* | | | | Merge pull request #34375 from y-yagi/add_connect_src_to_default_csp_initializerGuillermo Iguaran2018-11-062-0/+15
|\ \ \ \ \ | |/ / / / |/| | | | Add `connect_src` example to content security policy initializer
| * | | | Add `connect_src` example to content security policy initializeryuuji.yaginuma2018-11-042-0/+15
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If want to use `webpack-dev-server` with CSP enabled, need to specify `connect-src`. Related to: https://github.com/rails/webpacker/commit/cd7ecf4d48496341aecd81c0c2f69fe4e50a7cd4 This is a matter of `webpacker`. But since `webpacker` is now used by default, to prevent user confusion, I think that better to include an example of `connect-src.`
* / / / Add CVE note to security guide and gemspecsGannon McGibbon2018-11-061-0/+3
|/ / / | | | | | | | | | [ci skip]
* | | Keep new line after the last dependencyyuuji.yaginuma2018-11-041-1/+1
| | | | | | | | | | | | | | | If add a package with `yarn`, it will have a newline after the last dependency so let's match with that.
* | | Restore `encoding: utf8mb4` in database.ymlYasuo Honda2018-10-301-0/+1
| |/ |/| | | | | | | | | | | rails/rails#33853 and rails/rails#33929 removed `encoding: utf8mb4` from database.yml since at that time MySQL 5.1 is supported with the master branch. Since MySQL 5.1 has been dropped, we can restore `encoding: utf8mb4` in database.yml
* | Merge pull request #34208 from yskkin/inspect_with_parameter_filterRyuta Kamizono2018-10-261-1/+1
|\ \ | | | | | | Implement AR#inspect using ParameterFilter
| * | Implement AR#inspect using ParamterFilter.Yoshiyuki Kinjo2018-10-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | AR instance support `filter_parameters` since #33756. Though Regex or Proc is valid as `filter_parameters`, they are not supported as AR#inspect. I also add :mask option and #filter_params to `ActiveSupport::ParameterFilter#new` to implement this.
* | | Do not need to mention the method that is being called in the exceptionRafael Mendonça França2018-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | What is important to tell is that the database configuration could not be loaded. Fixes #34296.
* | | Merge pull request #34275 from bogdanvlviv/skip_yarn-to-skip_javascriptRafael França2018-10-2310-27/+17
|\ \ \ | | | | | | | | Remove `--skip-yarn` in favor of `--skip-javascript`
| * | | Remove node_modules path from assets load paths since we use webpack by defaultbogdanvlviv2018-10-222-9/+1
| | | | | | | | | | | | | | | | Related to #33079
| * | | Remove `--skip-yarn` in favor of `--skip-javascript`bogdanvlviv2018-10-2210-19/+17
| | | | | | | | | | | | | | | | | | | | | | | | Since #33079 Webpacker the default JavaScript compiler for Rails. Webpacker uses `yarn` so seems like it doesn't make sense for Rails to keep `--skip-yarn` option.
* | | | Merge pull request #34289 from jschulenklopper/patch-1George Claghorn2018-10-221-1/+1
|\ \ \ \ | | | | | | | | | | Add missing dot in comment in .gitignore template
| * | | | Add missing dot in comment in .gitignore templateJochem Schulenklopper2018-10-221-1/+1
| |/ / / | | | | | | | | | | | | My submission for the tiniest commit and PR contest: add a missing dot in a comment line in the generator template for .gitignore. (I just noticed this missing; consistency is king :-)
* | | | Merge pull request #34222 from bogdanvlviv/unify-changelog-entriesRafael França2018-10-221-24/+8
|\ \ \ \ | |/ / / |/| | | Unify changelog entries related to `database` option of Rails generators [ci skip]
| * | | Unify changelog entries related to `database` option of Rails generators [ci ↵bogdanvlviv2018-10-161-24/+8
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | skip] `migrations_paths` option was added to migration generator, with changelog entry, in #33760. Also `migrations_paths` option was added to model generator, with changelog entry, in #33994. Then `migrations_paths` was renamed to `database` and aliased as `db` in #34021, and was added new changelog entry. I think we should edit existed changelog entries instead adding new about changing the name of the option from `migrations_paths` to `database` since Rails 6.0 hasn't been released yet, and since It might confuse readers of the changelog file in case if they've read changelog enty about adding `migrations_paths` option but haven't read the entry about change the name of that option to `database`. @eileencodes, @gmcgibbon, @rafaelfranca Does it make sense?
* | | Merge pull request #34279 from ↵Ryuta Kamizono2018-10-221-1/+0
|\ \ \ | | | | | | | | | | | | | | | | bogdanvlviv/remove-extra-remove_file-skip_action_cable Remove extra call `remove_file` on `rails new` with `--skip_action_cable`
| * | | Remove extra call `remove_file` on `rails new` with `--skip_action_cable`bogdanvlviv2018-10-221-1/+0
| | | | | | | | | | | | | | | | | | | | There is no need to remove this file since the line below removes entire directory in which that file is placed.
* | | | Merge pull request #34274 from ↵Ryuta Kamizono2018-10-222-16/+1
|\ \ \ \ | |/ / / |/| | | | | | | | | | | bogdanvlviv/remove-yarn-files-from-gitignore-template Remove yarn's files from `.gitignore` template
| * | | Remove yarn's files from `.gitignore` template for new rails appbogdanvlviv2018-10-212-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Webpacker already does it, see https://github.com/rails/webpacker/blob/895d2cfc15eda2edae9e667c642a02523d958f53/lib/install/template.rb#L25-L33 I also opened PR https://github.com/rails/webpacker/pull/1765 in order to make it add `/yarn-error.log` file too.
* | | | Merge pull request #34277 from ↵Ryuta Kamizono2018-10-221-2/+0
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | bogdanvlviv/remove-javascripts-javascripts_engine-options-for-generators Remove `javascripts` and `javascript_engine` options for generators
| * | | | Remove `javascripts` and `javascript_engine` options for generatorsbogdanvlviv2018-10-221-2/+0
| |/ / / | | | | | | | | | | | | It is unused since #33079
* / / / Remove `:javascript` from `Rails::PluginBuilder::PASSTHROUGH_OPTIONS`bogdanvlviv2018-10-221-1/+1
|/ / / | | | | | | | | | `--javascript` option was removed by 42198064c35ff3b701496309f90df2abc229efbe
* | | Correct some tests related to changes in #33079 (#34272)Bogdan2018-10-222-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix assertions of auto-generated ActiveStorage JS Since #33079 * Correct message on the `assert_equal` failure Related to #33079 * Test ActionCable's js files This commit adds `app/javascript/channels/consumer.js`, and `app/javascript/channels/index.js` to `DEFAULT_APP_FILES` in order to assert their existance in `test_skeleton_is_created`. Related to #33079 * Assert no match `javascript_pack_tag` in `application.html.erb` Since #33079 `rails new` generates `application.html.erb` file with `javascript_pack_tag` instead of `javascript_include_tag`. Note that there some tests that asserting no matching `javascript_include_tag` in the `application.html.erb` file for newly generated rails plugins. It is related to #34009 and shouldn't be changed right now.
* | | Merge pull request #34260 from frodsan/fix/remove-unnecessary-escape-charRyuta Kamizono2018-10-201-2/+2
|\ \ \ | | | | | | | | Remove unnecessary escape character
| * | | Remove unnecessary escape characterFrancesco Rodríguez2018-10-191-2/+2
| | | |
* | | | Avoid running `webpacker:install` on tests that don't need ityuuji.yaginuma2018-10-202-6/+10
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | If use `run_generator` to run the generator, `--skip-webpack-install` is specified automatically. https://github.com/rails/rails/blob/3101a4136bd62787e252d2658eee23001036fa0f/railties/lib/rails/generators/testing/behaviour.rb#L71 However, when executing the generator independently (for example, to use stub), `webpacker:install` was executed. Since this includes `yarn install`, it should be avoided in unnecessary testing.
* | | Avoid running bundler on tests that don't need ityuuji.yaginuma2018-10-191-3/+3
|/ / | | | | | | | | If the dev option is specified, Gemfile contains gem which specifies GitHub. This will take time to execute, so should avoid it in unnecessary tests.
* | Fix generated Gemfile missing gems on jrubyDavid Rodríguez2018-10-171-1/+1
| |
* | Merge pull request #29204 from ↵Ryuta Kamizono2018-10-164-5/+21
|\ \ | |/ |/| | | | | | | RasPat1/issue-29200-scaffold-reference-display-memory-address Issue #29200 scaffold an object with a reference displays an object memory address to user
| * Show object ids in scaffold pages when displaying referenced objectsRasesh Patel2018-10-144-5/+20
|/ | | | | | | | | | | | Resolve Issue#29200 When scaffolding a model that references another model the generated show and index html pages display the object directly on the page. Basically, it just shows a memory address. That is not very helpful. In this commit we show the object's id rather than the memory address. This updates the scaffold templates and the json builder files.
* Runs the generator before assertionsyuuji.yaginuma2018-10-121-0/+1
|
* Add test retries for railtiesGannon McGibbon2018-10-111-0/+3
|
* Add multi-db support to rails db:migrate:statusGannon McGibbon2018-10-092-19/+56
|
* Use `--skip-webpack-install` by defaultyuuji.yaginuma2018-10-093-7/+7
| | | | To remove extra `--no-skip-javascript` tests.
* Avoid `webpacker:install` if unnecessaryyuuji.yaginuma2018-10-093-6/+7
| | | | | `webpacker:install` also includes execution of yarn, it takes time to execute, so avoid unnecessary tests.
* Add `skip-webpack-install` optionyuuji.yaginuma2018-10-093-1/+22
| | | | | This option is useful when want to check only the files generated by `rails new`, or if want to do something before `webpacker:install`.
* Merge pull request #34084 from trustvox/masterRafael França2018-10-052-4/+2
|\ | | | | Remove "include FileUtils" sentence in setup/update bin files
| * Remove "include FileUtils" sentence in setup/update bin filesBruno Casali2018-09-172-4/+2
| | | | | | | | | | According with rubocop style guide "Style/MixinUsage" is good to use only in class/module not directly in file.
* | Remove bundler warnings from bin/setup outputGannon McGibbon2018-10-051-8/+10
| |
* | Fix tests related to new JavaScript path for generatorsPrathamesh Sonpatki2018-10-054-8/+6
| | | | | | | | - Followup of https://github.com/rails/rails/commit/4838c1716a0340137d858fab49bf460e23be5a4b
* | Add retry_on/discard suggestions for common cases.Francesco Rodríguez2018-10-051-0/+5
| | | | | | | | | | | | | | | | This adds the same suggestions added here: https://github.com/rails/rails/blob/01a69e27a4e55504af8fe776826d659550e6f89e/activejob/lib/rails/generators/job/templates/application_job.rb These appear when `app/jobs/application_job.rb` doesn't exist, but not for new applications.
* | Avoid `webpacker:install` if unnecessaryyuuji.yaginuma2018-10-051-2/+2
| | | | | | | | | | Since this is a test to check the behavior of `load_defaults`, webpacker is unnecessary.
* | Revert "Merge pull request #33970 from rails/eager-url-helpers"schneems2018-10-032-14/+4
| | | | | | | | | | | | | | Until #34050 can be resolved This reverts commit 7f870a5ba2aa9177aa4a0e03a9d027928ba60e49, reversing changes made to 6556898884d636c59baae008e42783b8d3e16440.
* | Fix call sitesGannon McGibbon2018-10-021-1/+1
| |
* | Make Webpacker the default JavaScript compiler for Rails 6 (#33079)David Heinemeier Hansson2018-09-3034-291/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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