aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #35738 from gmcgibbon/aj_assert_drop_usec_docsGannon McGibbon2019-04-202-9/+28
|\ | | | | ActiveJob time argument assertion documentation
| * Add section on asserting time args for jobsGannon McGibbon2019-03-251-0/+19
| |
| * Fix assert_performed_with time testsGannon McGibbon2019-03-251-9/+9
| |
* | Remove duplicated testyuuji.yaginuma2019-04-201-12/+1
| | | | | | | | | | | | | | With 8b4d344815655027d9f7584c0a59271dce8f1d5a, `test_required_polymorphic_belongs_to_generates_correct_model` and `test_required_and_polymorphic_are_order_independent` are completely same. Also, remove `required` from test name because that not passed to generator.
* | Remove description for namespaced `db:migrate:up`eileencodes2019-04-191-1/+0
| | | | | | | | | | This was accidentally left in, the standard `db:migrate:up` doesn't have a description so `db:migrate:up:namespace` shouldn't have one either.
* | Merge pull request #36039 from ↵Eileen M. Uchitelle2019-04-193-1/+115
|\ \ | | | | | | | | | | | | eileencodes/add-up-and-down-to-multi-db-rake-tasks Handle up/down for multiple databases
| * | Handle up/down for multiple databaseseileencodes2019-04-193-1/+115
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds the ability to run up/down for a database in a multi-db environment. If you have an app with a primary and animals database the following tasks will be generated: ``` VERSION=123 rake db:migrate:up:primary VERSION=123 rake db:migrate:up:primary VERSION=123 rake db:migrate:down:primary VERSION=123 rake db:migrate:up:animals ``` I didn't generate descriptions with them since we don't generate a description for a single database application. In addition to this change I've made it so if your application has multiple databases Rails will raise if you try to run `up` or `down` without a namespace. This is because we don't know which DB you want to run `up` or `down` against unless the app tells us, so it's safer to just block it and recommend using namespaced versions of up/down respectively. The output for the raise looks like: ``` You're using a multiple database application. To use `db:migrate:down` you must run the namespaced task with a VERSION. Available tasks are db:migrate:down:primary and db:migrate:down:animals. ```
* | Merge pull request #36001 from prathamesh-sonpatki/null-false-default-belongs-toKasper Timm Hansen2019-04-195-9/+104
|\ \ | | | | | | Add `null: false` constraint by default for `belongs_to` associations
| * | Add `null: false` constraint by default for `belongs_to` associationsPrathamesh Sonpatki2019-04-195-9/+104
| | | | | | | | | | | | | | | | | | - Also deprecate passing {required} to the model generator. - Also made sure the global config `belongs_to_required_by_default` is applied correctly to the model generator for `null: false` option.
* | | Revert "Deprecate `collection_cache_key` which is private API"Ryuta Kamizono2019-04-193-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f656bb301a43fe441af0039e4fafe40a7faa62f8. Reason: Test in Action View expects the `collection_cache_key` working... https://github.com/rails/rails/blob/ff6b713f5e729859995f204093ad3f8e08f39ea8/actionview/test/activerecord/relation_cache_test.rb#L21 https://github.com/rails/rails/blob/ff6b713f5e729859995f204093ad3f8e08f39ea8/actionview/test/fixtures/project.rb#L6 https://buildkite.com/rails/rails/builds/60609#d19181fb-fe80-4d1e-891c-1109b540fb4b/981-1009
* | | Merge pull request #36000 from JosiMcClellan/fix-screenshot-filenamesEileen M. Uchitelle2019-04-192-1/+10
|\ \ \ | | | | | | | | handle long or duplicated screenshot filenames
| * | | truncate screenshot filenames to avoid errorJosi McClellan2019-04-182-1/+10
| | | |
* | | | Merge pull request #35998 from itsWill/add_documentation_for_add_indexEileen M. Uchitelle2019-04-191-0/+20
|\ \ \ \ | | | | | | | | | | Document algorithm: concurrent option for PostgreSQL [ci skip]
| * | | | Document algorithm: concurrent options for PostgreSQL [ci skip]Guilherme Mansur2019-04-161-0/+20
| | | | |
* | | | | Merge pull request #36037 from kamipo/deprecate_methodsRyuta Kamizono2019-04-192-26/+7
|\ \ \ \ \ | | | | | | | | | | | | Refactor `ActiveSupport::Deprecation.deprecate_methods` not to expose internal methods
| * | | | | Refactor `ActiveSupport::Deprecation.deprecate_methods` not to expose ↵Ryuta Kamizono2019-04-192-26/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | internal methods In #33325, `deprecate_methods` is replaced from `prepend` to completely emurated `alias_method_chain`, it exposed two internal methods `xxx_with_deprecation` and `xxx_without_deprecation`. After that, #34648 restored the `prepend` implementation, which doesn't expose any internal methods, so we no longer be able to ensure to always expose that internal methods. As I said at https://github.com/rails/rails/pull/33325#issuecomment-409016725, I think that internal methods exposed is not a specification but a limitation when using `alias_method_chain`, there is no longer a reason to follow that limitation.
* | | | | | Deprecate `collection_cache_key` which is private APIRyuta Kamizono2019-04-193-3/+9
| |_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `collection_cache_key` is private API for a long time, but I've maintained it in #35848 since it is mentioned in the doc (https://github.com/rails/rails/pull/35848#discussion_r272011475). The doc has removed at 1da9a7e4, so there is no longer a reason to maintain that private API.
* | | | | Merge pull request #34788 from gsamokovarov/actionable-errorsKasper Timm Hansen2019-04-1920-3/+331
|\ \ \ \ \ | | | | | | | | | | | | Introduce Actionable Errors
| * | | | | Refactor after the most recent code reviewGenadi Samokovarov2019-04-195-19/+19
| | | | | |
| * | | | | Dispatch actions only if config.consider_all_requests_local is setGenadi Samokovarov2019-04-192-1/+11
| | | | | |
| * | | | | Tweak the ActionableError docs a bitGenadi Samokovarov2019-04-191-4/+2
| | | | | |
| * | | | | Simplify the ActionableError.{dispatch,action} boundriesGenadi Samokovarov2019-04-193-3851/+75
| | | | | |
| * | | | | Drop the ambiguous `ActiveSupport::ActionableError#===` checkGenadi Samokovarov2019-04-194-26/+67
| | | | | |
| * | | | | Manage ActionDispatch::ActionableExceptions from the default middleware stackGenadi Samokovarov2019-04-195-62/+3827
| | | | | |
| * | | | | Make ActiveRecord::PendingMigrationError actionableGenadi Samokovarov2019-04-192-2/+10
| | | | | |
| * | | | | Introduce Actionable ErrorsGenadi Samokovarov2019-04-1915-2/+284
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Actionable errors let's you dispatch actions from Rails' error pages. This can help you save time if you have a clear action for the resolution of common development errors. The de-facto example are pending migrations. Every time pending migrations are found, a middleware raises an error. With actionable errors, you can run the migrations right from the error page. Other examples include Rails plugins that need to run a rake task to setup themselves. They can now raise actionable errors to run the setup straight from the error pages. Here is how to define an actionable error: ```ruby class PendingMigrationError < MigrationError #:nodoc: include ActiveSupport::ActionableError action "Run pending migrations" do ActiveRecord::Tasks::DatabaseTasks.migrate end end ``` To make an error actionable, include the `ActiveSupport::ActionableError` module and invoke the `action` class macro to define the action. An action needs a name and a procedure to execute. The name is shown as the name of a button on the error pages. Once clicked, it will invoke the given procedure.
* | | | | | Merge pull request #36019 from abhaynikam/35845-add-webpacker-gem-to-update-taskEileen M. Uchitelle2019-04-191-0/+13
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | Adds a warning message for action text installer if application pack …
| * | | | | Adds a warning message for action text installer if application pack is missing.Abhay Nikam2019-04-191-0/+13
| | | | | |
* | | | | | Fix const `Post` leakage in `test/cases/base_test.rb`Ryuta Kamizono2019-04-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | https://buildkite.com/rails/rails/builds/60601#81daf2ee-9259-42e5-983d-c57d66499b76/928-939
* | | | | | Give GeneratedRelationMethods module a nameRyuta Kamizono2019-04-193-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | This follows #35595.
* | | | | | Revert renamed `GeneratedAttributeMethods`Ryuta Kamizono2019-04-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This partly reverts 8ca3c286a768038f6b391fd3bfbdfcc299876a1f. `.is_a?(GeneratedAttributeMethodsBuilder)` doesn't make sense to me, the module class's `new` creates just an instance of the module class itself.
* | | | | | Merge pull request #36033 from akinomaeni/hide_help_for_dev_commandYuji Yaginuma2019-04-191-2/+4
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | Help command for visible commands should be hidden
| * | | | | Help command for visible commands should be hiddenakinomaeni2019-04-191-2/+4
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``` $ rails --help > tmp/before $ bundle update rails ... $ rails --help > tmp/after $ diff -u tmp/before tmp/after --- tmp/before 2019-04-19 00:12:08.000000000 -0700 +++ tmp/after 2019-04-19 00:14:55.000000000 -0700 @@ -52,7 +52,6 @@ db:version destroy dev:cache - dev:help encrypted:edit encrypted:show initializers ```
* | | | | Fix `yarn.lock`yuuji.yaginuma2019-04-191-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | The trix moved to a peer dependency since 11b73c40c289b03226da5d3f5a8d71b009390dbd. So that does not include in `yarn.lock`.
* | | | | Document redis: Object optionSteven Harman2019-04-181-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are four ways to pass the redis option, but only three were documented. This is now consistent with implementation. [ci skip]
* | | | | Merge pull request #36012 from r7kamura/feature/safe-buffer-multiplicationRyuta Kamizono2019-04-193-0/+26
|\ \ \ \ \ | | | | | | | | | | | | Preserve html_safe? status on ActiveSupport::SafeBuffer#*
| * | | | | Preserve html_safe? status on ActiveSupport::SafeBuffer#*r7kamura2019-04-193-0/+26
| | | | | |
* | | | | | Merge pull request #36018 from aricwalker/parallel-setup-exceptionEileen M. Uchitelle2019-04-181-1/+10
|\ \ \ \ \ \ | | | | | | | | | | | | | | Catch exceptions raised in `parallelize_setup` and ensure tests fail when they occur
| * | | | | | If exception occurs during setup, add to each test executedAric Walker2019-04-181-1/+10
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolves https://github.com/rails/rails/issues/35835 If an exception occurs during `parallelize_setup` make sure to catch that exception and apply it to the result of each successive test run. This results in marking all of the tests as failed to bring attention to the issue & ensure it is addressed before proceeding.
* | | | | | Merge pull request #36023 from ↵Eileen M. Uchitelle2019-04-182-7/+9
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | eileencodes/fix-active-record-to-not-require-railties Ensure active record can load without Railties
| * | | | | Ensure active record can load without Railtieseileencodes2019-04-182-7/+9
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I added the rake tasks for multiple databases I accidentally made it so you couldn't use Active Record without Railties. Since getting the database configuration depends on being able to load Railties (there is no other way to read and parse the yaml file and load it) I've decided that using multiple databases outside of Rails is a no-op. I've changed the code here to return if Rails isn't defined. Then I changed the other tasks to use `ActiveRecord::Tasks::DatabaseTasks.env` instead of `Rails.env`. The multi-db tasks can keep using `Rails.env` because they'll only be generated if we're using Rails and not just Active Record.
* | | | | Merge pull request #36014 from utilum/update_rake_to_latest_versionRyuta Kamizono2019-04-181-1/+1
|\ \ \ \ \ | |/ / / / |/| | | | Update Rake to the latest version
| * | | | Update Rake to the latest versionutilum2019-04-181-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes railties ApplicationTests failures in Ruby 2.7. Rake 12.3.2 includes a [Fix for test fails caused by 2.6 warnings](https://github.com/ruby/rake/pull/297). Upadting prevents failures of: - `RakeTests::RakeMigrationsTest#test_migration_status_when_schema_migrations_table_is_not_present` - `RakeDbsTest#test_db:structure:dump_does_not_dump_schema_information_when_no_migrations_are_used` - `BinSetupTest#test_bin_setup_output` See [failures log](https://gist.githubusercontent.com/utilum/30e081cc38b5d90e18be8cede6385b10/raw/2b89e568977d4f1fe010726a9a561c10e59c8df8/tests.log). ruby 2.7.0dev (2019-04-18 trunk 67602) [x86_64-linux]
* | | | Merge pull request #36010 from ↵George Claghorn2019-04-171-0/+25
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | yoones/add-activestorage-instrumentation-hooks-to-guide Mention more ActiveStorage hooks in Active Support Instrumentation guide [ci skip]
| * | | | Mention more ActiveStorage hooks in Active Support Instrumentation guide [ci ↵Younes SERRAJ2019-04-171-0/+25
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | skip] Hooks added: - `service_download_chunk.active_storage` - `service_update_metadata.active_storage` - `preview.active_storage`
* | | | Merge pull request #35052 from schuetzm/silence-i18n-fallback-deprecationKasper Timm Hansen2019-04-171-1/+2
|\ \ \ \ | | | | | | | | | | Describe how to silence the deprecation warning about empty I18n fall…
| * | | | Describe how to silence the deprecation warning about empty I18n fallbacksMarc Schütz2019-01-251-1/+2
| | | | |
* | | | | Merge pull request #36009 from abhaynikam/fix-model-generator-test-typoKasper Timm Hansen2019-04-171-1/+1
|\ \ \ \ \ | |_|/ / / |/| | | | Fix typo in test description from generages -> generates
| * | | | Fix typo in test description from generages -> generatesAbhay Nikam2019-04-171-1/+1
|/ / / /
* | | | Merge pull request #35886 from okuramasafumi/add-docs-to-concernRyuta Kamizono2019-04-171-1/+24
|\ \ \ \ | | | | | | | | | | Add documentations to concern methods [ci skip]