aboutsummaryrefslogtreecommitdiffstats
path: root/railties
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #28534 from claudiob/list-webpackersRafael França2017-03-221-1/+2
|\ | | | | List options for `rails new --webpack=WEBPACK`
| * List options for `rails new --webpack=WEBPACK`claudiob2017-03-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you type `rails new -h`, the `--database=DATABASE` options display this useful message: > Preconfigure for selected database (options: mysql/postgresql/sqlite3/oracle/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc) However, the `--webpack=WEBPACK` option only displays this: > Preconfigure for app-like JavaScript with Webpack so it's hard to know *which* values are valid for `WEBPACK`. This commit improves the help message to display: > Preconfigure for app-like JavaScript with Webpack (options: react/vue/angular) The implication of this commit is that the list needs to be manually updated whenever rails/webpacker adds support for a new framework. However, I don't imagine this list to change very frequently, and I think that the benefit of display the list to the users is greater than the hustle of updating the list when needed.
* | Merge pull request #28527 from rst/fix_runner_argv_28515Rafael França2017-03-222-2/+11
|\ \ | | | | | | Correctly reset ARGV for "rails runner `CODE' arg arg arg..."
| * | Fixup trailing whitespace, per complaints from CodeClimate.Robert Thau2017-03-221-1/+1
| | |
| * | Correctly reset ARGV for "rails runner `CODE' arg arg arg..."Robert Thau2017-03-222-2/+11
| | | | | | | | | | | | | | | | | | The code itself should not be in the ARGV vector. Fixes #28515
* | | Merge pull request #28513 from maclover7/jm-fix-28500Rafael França2017-03-222-2/+12
|\ \ \ | | | | | | | | CLI arg "host" has precedence over ENV var "host"
| * | | CLI arg "host" has precedence over ENV var "host"Jon Moss2017-03-212-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a regression from when the server command switched to its own argument parser, as opposed to Rack's. Rack's argument parser, when provided with a "host" argument, gives that value precedence over environment variables.
* | | | Merge pull request #28524 from claudiob/comment-api-keyRafael França2017-03-221-2/+2
|\ \ \ \ | |_|_|/ |/| | | Don't add a dummy API key to every new Rails app
| * | | Don't add a dummy API key to every new Rails appclaudiob2017-03-221-2/+2
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every new Rails app is currently generated with `Rails.application.secrets[:api_key]` set to `123`. This comes from a line in `config/secrets.yml` that, in my opinion, should be left commented out to only serve as a syntax example, rather than being actually set in every Rails app. Additionally, we might want to give a better example than `123`, since in the same file we are suggesting to > Make sure the secret is at least 30 characters and all random, > no regular words or you'll be exposed to dictionary attacks. The result of this commit is that `config/secrets.yml` will include something like: ```yaml # Shared secrets are available across all environments. # shared: # api_key: f56930851993982510d5bd9236f4108f6fe7c15448f1c6923a51872e0dbae1a24d274b318abb6518b540dfb51079c61640885f607467e5ed1053849be7587d61 ``` rather than this: ```yaml # Shared secrets are available across all environments. shared: api_key: 123 ```
* / | Don't comment out config.file_watcher during Rails upgradeyuuji.yaginuma2017-03-222-16/+0
|/ / | | | | | | | | | | | | This is necessary only when updating to Rails 5.0, it is not necessary for updating to 5.1. Related #24243
* / Start Rails 5.2 developmentMatthew Draper2017-03-224-201/+7
|/
* Remove 5.0.0 entry from 5.1.0 CHANGELOG [ci skip]claudiob2017-03-201-4/+0
| | | | | | | | | | | The entry for PR #25430 is currently present both in the CHANGELOG for Rails 5.0 and for Rails 5.1: https://github.com/rails/rails/blame/9d3a352777c2594123583b0bc02d0dd80f1e385b/railties/CHANGELOG.md#L61-L72 Since the PR was backported to 5-0-stable in #25499, I believe it should be removed from the CHANGELOG of 5.1, otherwise it looks like something changed from 5.0 to 5.1
* Default to yielding a `form` variable.Kasper Timm Hansen2017-03-202-12/+12
| | | | More intention revealing and means `f` can go F itself 😋
* Merge pull request #28406 from ↵Kasper Timm Hansen2017-03-201-1/+1
|\ | | | | | | | | chukitow/feature/user-form-with-instead-of-form-for-scaffold user form with instead of form for in scaffold generator
| * disable remote submitsIvan Velasquez2017-03-141-1/+1
| |
| * user form with instead of form for in scaffold generatorIvan Velasquez2017-03-131-1/+1
| |
* | Add `app:update` task to enginesyuuji.yaginuma2017-03-205-1/+51
| | | | | | | | | | | | Occasionally we update the file generated by engine. Therefore, I think that there is a task for updating as well as application in the engine, it is convenient for updating.
* | Merge pull request #28481 from y-yagi/fix_warningKasper Timm Hansen2017-03-201-3/+3
|\ \ | | | | | | Fix `warning: character class has duplicated range`
| * | Fix `warning: character class has duplicated range`yuuji.yaginuma2017-03-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following warnings: ``` railties/test/generators/encrypted_secrets_generator_test.rb:15: warning: character class has duplicated range: /[\w\d]+/ railties/test/generators/encrypted_secrets_generator_test.rb:18: warning: character class has duplicated range: /production:\n# external_api_key: [\w\d]+/ railties/test/generators/encrypted_secrets_generator_test.rb:19: warning: character class has duplicated range: /production:\n# external_api_key: [\w\d]+/ ```
* | | Correctly check whether key is defined in configurationyuuji.yaginuma2017-03-193-4/+16
|/ / | | | | | | | | | | | | | | | | | | | | | | | | It can not check correctly with `defined?` ```ruby irb(main):001:0> Rails.application.config.active_record => {:maintain_test_schema=>true, :belongs_to_required_by_default=>true} irb(main):002:0> defined?(Rails.application.config.active_record) => nil ``` Follow up to #28469
* | Track the version-compatible config settings inside railtiesMatthew Draper2017-03-187-59/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of forcing new applications to carry an initializer that just switches things to what their default "should" be, we can handle it internally. The initializer is then only used by upgraders: it shows what the new default would be (commented out), while their upgraded application continues to operate as it did before. Under this model, a multiply-upgraded application could accumulate several new_framework_defaults_*.rb files, for each release series it has traversed. A given release series only needs to generate the latest, though, because we don't support `rails app:upgrade` while skipping releases.
* | Bump Capybara and include Minitest::Assertionseileencodes2017-03-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Capybara was updated in teamcapybara/capybara#1841 to use Minitest style assertions so that system test output shows x number of assertions, x numbe of failures, etc. Before: ``` 6 runs, 0 assertions, 0 failures, 0 errors, 0 skips ``` After: ``` 6 runs, 7 assertions, 1 failures, 0 errors, 0 skips ``` This change bumps Capybara from 2.7.0 to 2.13.0 and includes the required minitest assertion file in the test case. :tada:
* | Merge pull request #28368 from y-yagi/add_test_for_secrets_commandKasper Timm Hansen2017-03-151-0/+13
|\ \ | | | | | | Add secrets edit test
| * | Add secrets edit testyuuji.yaginuma2017-03-121-0/+13
| | |
* | | Merge pull request #28409 from y-yagi/make_destroy_command_work_within_enginesEileen M. Uchitelle2017-03-152-2/+57
|\ \ \ | | | | | | | | Make destroy command work within engines
| * | | Make destroy command work within enginesyuuji.yaginuma2017-03-142-2/+57
| |/ / | | | | | | | | | | | | Instead of calling methods of Rails.application directly, we need to use a method that is considered for the rails engine.
* | | Merge pull request #28422 from ↵Kasper Timm Hansen2017-03-151-7/+7
|\ \ \ | | | | | | | | | | | | | | | | y-yagi/rename_app_update_test_to_more_appropriate_name Rename test of `app:update` to more appropriate name
| * | | Rename test of `app:update` to more appropriate nameyuuji.yaginuma2017-03-151-7/+7
| |/ / | | | | | | | | | | | | `rails:update` was changed to `app:update` in 6fb31638c8b61731103d4963272755b217a2df87. Therefore, I think that it is better that the test name is also `app_update`.
* | / Add CHANGELOG entry for --skip-coffee [ci skip]claudiob2017-03-141-0/+4
| |/ |/| | | | | Was added in #25248 by @bluesh55
* | Move "fixes" to a new lineJon Moss2017-03-131-1/+3
|/ | | | [ci skip]
* Merge pull request #28182 from y-yagi/show_correct_rails_commandsKasper Timm Hansen2017-03-098-18/+47
|\ | | | | Show correct commands in help
| * Show correct commands in helpyuuji.yaginuma2017-03-038-18/+47
| | | | | | | | | | Currently rails' help shows only namespace. However, the secrets command needs to specify command. Therefore, I fixed the command to display in help.
* | [ci skip] Document read_encrypted_secrets config.Kasper Timm Hansen2017-03-091-0/+8
| | | | | | | | | | | | Mostly just that it's there. Closes #28193.
* | Use appropriate type in generators testyuuji.yaginuma2017-03-081-1/+1
| | | | | | | | | | | | | | | | This fixes the following thor's warning. ``` Expected string default value for '--generate'; got false (boolean) ```
* | [ci skip] 🎬 expensive: take twoKasper Timm Hansen2017-03-061-1/+1
| |
* | Merge pull request #28257 from yahonda/app_generators_use_oracle_enhancedAndrew White2017-03-062-5/+6
|\ \ | | | | | | Update `database.yml` when `rails new <new_app> -d oracle` specified
| * | Update `database.yml` when `rails new <new_app> -d oracle` specifiedYasuo Honda2017-03-022-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Install "activerecord-oracle_enhanced-adapter". Oracle adapter used to be a bundled one. Now it is a 3rd party one. Also "ruby-oci8" is a required gem for CRuby, not for JRuby. - Remove oracle entry for JRuby since Oracle enhanced adapter supports both CRuby and JRuby with single gem. - Change adapter name from `oracle` to `oracle_enhanced` in the oracle.yml. Not changing `-d oracle` - Update `DATABASE_URL` entry to use a dash instead of an underscore Refer https://github.com/rails/rails/commit/d72a0cbc807a14d3eec02a53317d11b9d9fa5815 for the reason.
* | | Avoid running system tests by defaultRobin Dupret2017-03-055-10/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tests may be expansive so let's only allow users to run them through `bin/rails test:system` or by passing a path to the `test` command. The same applies for `bin/rake test`. Refs #28109.
* | | A private method can't be called with `self.`Akira Matsuda2017-03-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | So calling `filename_with_extensions` omitting the second argument like this https://github.com/slim-template/slim-rails/blob/8dbc1fbf859ebfa95b0884a0196a6ad9f0ca9cd5/lib/generators/slim/scaffold/scaffold_generator.rb#L10 causes NoMethodError. fixes #28275
* | | Remove unnecessary system test codeeileencodes2017-03-031-13/+0
| | | | | | | | | | | | | | | | | | | | | It turns out that we don't need to require system tests in the railties test helper so we can remove it. If you're using system tests they will be loaded by inheriting from ActionDispatch::SystemTestCase and the routes will be loaded by ActionDispatch::IntegrationTest.
* | | Fix random failure on system test with ajaxFumiaki MATSUSHIMA2017-03-031-0/+28
|/ / | | | | | | | | | | | | | | If application has ajax, browser may begin request after rollback. `teardown_fixtures` will be called after `super` on `after_teardown` so we must call `Capybara.reset_sessions!` before `super` https://github.com/rails/rails/blob/b61a56541aecd7ac685d4f19d943177a3f1b465a/activerecord/lib/active_record/fixtures.rb#L857
* | [ci skip] Add changelog entry for #28139.Kasper Timm Hansen2017-03-021-0/+16
| | | | | | | | Includes a script to ease an app's upgrade.
* | Inline CIPHER constant.Kasper Timm Hansen2017-03-021-6/+3
| |
* | Move key packing into encryptor.Kasper Timm Hansen2017-03-022-6/+4
| |
* | Add back yaml require.Kasper Timm Hansen2017-03-021-0/+1
| |
* | Merge pull request #28139 from stouset/update-secrets-to-use-modern-cryptoKasper Timm Hansen2017-03-022-17/+16
|\ \ | | | | | | Update secrets to use modern crypto
| * | Default Secrets to AES-128-GCM, using ActiveSupport::MessageEncryptorStephen Touset2017-03-012-17/+16
| | | | | | | | | | | | Fixes #28135.
* | | Convert `ENV["EDITOR"]` to string before checkyuuji.yaginuma2017-03-021-1/+1
| | | | | | | | | | | | | | | | | | In order to avoid `NoMethodError` when it is nil. Follow up to 82f7dc6178f86e5e2dd82f9e528475a6acee6cd8
* | | [ci skip] Add changelog entry for encrypted secrets.Kasper Timm Hansen2017-03-011-0/+14
| | | | | | | | | | | | Just dispatch to the command help itself for more info.
* | | Put it to me straight: just say it.Kasper Timm Hansen2017-03-011-3/+3
| | | | | | | | | | | | Prefer Thor's say method to Kernel's plain puts.