- 18 12月, 2017 1 次提交
-
-
由 yuuji.yaginuma 提交于
To prevent errors from being raise in environments where credentials is unnecessary. Context: https://github.com/rails/rails/issues/31283#issuecomment-348801489 Fixes #31283
-
- 17 12月, 2017 1 次提交
-
-
由 yuuji.yaginuma 提交于
Follow up of #31391
-
- 16 12月, 2017 1 次提交
-
-
由 yuuji.yaginuma 提交于
`bootsnap` is a useful gem normally. However, `bootsnap` is unnecessary when generating a Rails application to be used only for testing. So I want to control whether use this or not by option.
-
- 14 12月, 2017 3 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up of #31432.
-
由 Olivier Lacan 提交于
This new ActiveRecord configuration option allows you to easily pinpoint what line of application code is triggering SQL queries in the development log by appending below each SQL statement log the line of Ruby code that triggered it. It’s useful with N+1 issues, and to locate stray queries. By default this new option ignores Rails and Ruby code in order to surface only callers from your application Ruby code or your gems. It is enabled on newly generated Rails 5.2 applications and can be enabled on existing Rails applications: ```ruby Rails.application.configure do # ... config.active_record.verbose_query_logs = true end ``` The `rails app:upgrade` task will also add it to `config/development.rb`. This feature purposely avoids coupling with ActiveSupport::BacktraceCleaner since ActiveRecord can be used without ActiveRecord. This decision can be reverted in the future to allow more configurable backtraces (the exclusion of gem callers for example).
-
由 Mehmet Emin INAC 提交于
-
- 12 12月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up of #31390.
-
- 09 12月, 2017 2 次提交
-
-
由 Aaron Patterson 提交于
Option parsing happens too late to have any impact on the Rails environment. Rails accesses the environment name and memoizes it too early in the boot process for a commandline option to have any impact on the database connection, so we'll change this test to set the environment from an environment variable (and ensure it still works when running tests with `ruby`)
-
由 Aaron Patterson 提交于
When tests are run with just `ruby`, the RAILS_ENV is set to `development` too early, and we connect to the development database rather than the test database.
-
- 07 12月, 2017 1 次提交
-
-
由 Aaron Patterson 提交于
I frequently run tests with `ruby`, not with a runner like `rake` or `rails`. When running the test with just `ruby` the `RAILS_ENV` environment variable did not get set to "test", and this would cause the tests to fail (and even mutate the development database!) This commit adds integration tests for running tests with just `ruby` and ensures the environment gets defaulted to "test". I also added a test to ensure that passing an environment to `-e` actually works (and fixed that case too). An interesting / annoying thing is that Minitest picks up it's plugins by asking RubyGems for a list of files: https://github.com/seattlerb/minitest/blob/ca6a71ca901016db09a5ad466b4adea4b52a504a/lib/minitest.rb#L92-L100 This means that RubyGems needs to somehow know about the file before it can return it to Minitest. Since we are not packaging Rails as a Gem before running the integration tests on it (duh, why would you do that?), RubyGems doesn't know about the file, so it can't tell Minitest, so Minitest doesn't automatically require it. This means I had to manually require and insert the plugin in our integration test. I've left comments about that in the test as well. Ugh.
-
- 05 12月, 2017 2 次提交
-
-
由 Tsukuru Tanimichi 提交于
-
由 Tsukuru Tanimichi 提交于
-
- 04 12月, 2017 1 次提交
-
-
由 Tsukuru Tanimichi 提交于
We probably don't have any tests for the `--webpack` option. related: #27288
-
- 03 12月, 2017 2 次提交
-
-
由 yuuji.yaginuma 提交于
This is necessary in order to make the processing dependent on `Migrator.current_version` work even without database. Context: https://github.com/rails/rails/pull/31135#issuecomment-348404326
-
由 claudiob 提交于
With the current code, a failing test shows this error, which is missing the number of times called and has two periods at the end. ``` /railties$ be ruby -Itest test/generators/app_generator_test.rb -n test_active_storage_install Failure: AppGeneratorTest#test_active_storage_install [test/generators/app_generator_test.rb:313]: active_storage:install expected to be called once, but was called times.. Expected: 1 Actual: 2 ``` After the fix, the error message looks correct: ``` /railties$ be ruby -Itest test/generators/app_generator_test.rb -n test_active_storage_install Failure: AppGeneratorTest#test_active_storage_install [test/generators/app_generator_test.rb:313]: active_storage:install expected to be called once, but was called 2 times. Expected: 1 Actual: 2 ```
-
- 30 11月, 2017 1 次提交
-
-
由 yuuji.yaginuma 提交于
Fixes #31286
-
- 28 11月, 2017 1 次提交
-
-
由 yuuji.yaginuma 提交于
Follow up of 924a368f
-
- 27 11月, 2017 4 次提交
-
-
由 yuuji.yaginuma 提交于
Since `ContentSecurityPolicy::Middleware` is not loaded in API-only Applications, initializer is unnecessary. Ref: https://github.com/rails/rails/blob/9c10fec4c06da38f8975dfb851f4d899aa85f8b7/railties/lib/rails/application/default_middleware_stack.rb#L66..L68
-
由 Prathamesh Sonpatki 提交于
- Followup of #31162
-
由 yuuji.yaginuma 提交于
In order to use early hints, need to use Puma 3.11.0 or higher. So, I think that should specify that version in newly generated applications. Ref: https://github.com/puma/puma/commit/f6f3892f4d82638fb7a2a57d993641b1486ee88a
-
- 26 11月, 2017 2 次提交
-
-
由 yuuji.yaginuma 提交于
This was added with 27f103fc for link labels and fields. However, `form_with` changed to generates ids by default with d3893ec3. So I think that adding an explicit ids is unnecessary.
-
由 npezza93 提交于
When `form_with` was introduced we disabled the automatic generation of ids that was enabled in `form_for`. This usually is not an good idea since labels don't work when the input doesn't have an id and it made harder to test with Capybara. You can still disable the automatic generation of ids setting `config.action_view.form_with_generates_ids` to `false.`
-
- 22 11月, 2017 1 次提交
-
-
由 willnet 提交于
-
- 18 11月, 2017 1 次提交
-
-
由 yuuji.yaginuma 提交于
Since fbd1e98c, Rails plugin does not run `bundle install` when generating. Therefore, `after_bundle` callback is not actually executed after `bundle`. Since there is a difference between the name and the actual behavior, I think that should be remove.
-
- 16 11月, 2017 2 次提交
-
-
由 yuuji.yaginuma 提交于
We generate master key on `rails new`. Therefore, if do not add master key to `.gitginore` on `rails new`as well, there is a possibility that the master key will be committed accidentally.
-
由 Wojciech Wnętrzak 提交于
To edit/show encrypted file: ``` bin/rails encrypted:edit config/staging_tokens.yml.enc bin/rails encrypted:edit config/staging_tokens.yml.enc --key config/staging.key bin/rails encrypted:show config/staging_tokens.yml.enc ``` Also provides a backing Rails.application.encrypted API for Ruby access: ```ruby Rails.application.encrypted("config/staging_tokens.yml.enc").read Rails.application.encrypted("config/staging_tokens.yml.enc").config Rails.application.encrypted("config/staging_tokens.yml.enc", key: "config/staging.key") ```
-
- 14 11月, 2017 3 次提交
-
-
由 Nikita Penzin 提交于
Ensure plugin_generator adds to new line in Gemfile, even if the Gemfile does not end with an empty line. [Lisa Ugray, Nikita Penzin]
-
由 Yuji Yaginuma 提交于
Currently the environment is not loaded in some db tasks. Therefore, if use encrypted secrets values in `database.yml`, `read_encrypted_secrets` will not be true, so the value can not be used correctly. To fix this, added `environment` as dependency of `load_config`. It also removes explicit `environment` dependencies that are no longer needed. Fixes #30717
-
由 Rafael Mendonça França 提交于
Make clear that the files are not to be run for interpreters. Fixes #23847. Fixes #30690. Closes #23878.
-
- 13 11月, 2017 1 次提交
-
-
由 Kasper Timm Hansen 提交于
Allow edits of existing encrypted secrets generated on Rails 5.1, but refer to credentials when attempting to setup. This also removes the need for any of the setup code, so the generator can be ripped out altogether.
-
- 09 11月, 2017 2 次提交
-
-
由 yuuji.yaginuma 提交于
Since credentials generator is executed via the credentials command and does not need to be executed directly, so it is not necessary to show it in help.
-
由 bogdanvlviv 提交于
These were added in #30101, after #31084 it became redundant.
-
- 08 11月, 2017 2 次提交
-
-
由 yuuji.yaginuma 提交于
Since isolation application is generated with the `--skip-gemfile` option, so `active_storage:install` is not executed.
-
由 yuuji.yaginuma 提交于
In order to execute the `rails` command, need to run bundle install in advance. Therefore, if skipped bundle install, `rails` command may fail and should not do it.
-
- 07 11月, 2017 4 次提交
-
-
由 bogdanvlviv 提交于
Ensure that `bin/rails db:migrate` with specified `VERSION` reverts all migrations only if `VERSION` is `0`. Raise error if target migration doesn't exist.
-
由 bogdanvlviv 提交于
-
由 bogdanvlviv 提交于
Omit `rails activestorage:install` for jdbcmysql, jdbc and shebang tests AppGeneratorTest#test_config_jdbcmysql_database rails aborted! LoadError: Could not load 'active_record/connection_adapters/mysql_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (compressed) bin/rails:4:in `<main>' Tasks: TOP => activestorage:install => environment (See full trace by running task with --trace) AppGeneratorTest#test_config_jdbc_database rails aborted! LoadError: Could not load 'active_record/connection_adapters/jdbc_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. (compressed) bin/rails:4:in `<main>' Tasks: TOP => activestorage:install => environment (See full trace by running task with --trace) AppGeneratorTest#test_shebang_is_added_to_rails_file /home/ubuntu/.rbenv/versions/2.4.1/bin/ruby: no Ruby script found in input (LoadError) Prevent PendingMigrationError in tests * Run `bin/rails db:migrate RAILS_ENV=test` in test_cases before start tests to prevent PendingMigrationError * FileUtils.rm_r("db/migrate") * --skip-active-storage Fix failed tests in `railties/test/railties/engine_test.rb` Related to #30111 Imporve `SharedGeneratorTests#test_default_frameworks_are_required_when_others_are_removed` - Explicitly skip active_storage - Ensure that skipped frameworks are commented - Ensure that default frameworks are not commented Fix error `Errno::ENOSPC: No space left on device - sendfile` Since `rails new` runs `rails active_storage:install` that boots an app. Since adding Bootsnap 0312a5c6 during booting an app, it creates the cache: 264K tmp/cache/bootsnap-load-path-cache 27M tmp/cache/bootsnap-compile-cache * teardown_app must remove app
-
由 bogdanvlviv 提交于
Closes #30102 Revert part 787fe90d --skip-active-storage pass throughs `rails plugin new` Add changelog entry about default initialization of Active Storage
-
- 05 11月, 2017 1 次提交
-
-
由 yuuji.yaginuma 提交于
Currently, namespaced scaffold generator will generate an incorrect path and the generated file will not work properly. ``` $ ./bin/rails g scaffold admin/user $ ./bin/rails db:migrate $ ./bin/rails t test/controllers # Running: E Error: Admin::UsersControllerTest#test_should_create_admin_user: NameError: undefined local variable or method `admin_admin_users_url' for #<Admin::UsersControllerTest:0x000055a59f25ff68> Did you mean? admin_users test/controllers/admin/users_controller_test.rb:20:in `block (2 levels) in <class:UsersControllerTest>' test/controllers/admin/users_controller_test.rb:19:in `block in <class:UsersControllerTest>' bin/rails test test/controllers/admin/users_controller_test.rb:18 ``` This is because combine `controller_class_path` and `singular_table_name` to generate route. https://github.com/rails/rails/blob/360698aa245b45349d1d1b12e1afb34759515e69/railties/lib/rails/generators/named_base.rb#L172 Normally, if using namspaced generator, table name already contains namespace. Therefore, adding `controller_class_path` adds extra namespace. Since it is special only when explicitly specifying `model-name`, it is modified to change the value only when `model-name`is specified. Follow up of #30729
-