- 03 8月, 2020 1 次提交
-
-
由 Ryuta Kamizono 提交于
Avoid implicit `create_with` for `StiClass.all`
-
- 02 8月, 2020 1 次提交
-
-
由 Matthew Draper 提交于
Validate inclusion of each object in an array
-
- 01 8月, 2020 8 次提交
-
-
由 Ryuta Kamizono 提交于
Regardless of whether doing implicit `create_with` or not, `sti_name` is set by `ensure_proper_type`. https://github.com/rails/rails/blob/11f54e12b992f6c8d29fd9bedd89ac438a928a2f/activerecord/lib/active_record/inheritance.rb#L289-L304 The purpose of the `create_with` is to suppress/override `type_condition`, since `type_condition` will be an array of all sti subclass names for `scope_for_create`, it is not desired behavior for `scope_for_create`, and it will cause `find_sti_class` to fail. That undesired behavior was derived from `In` arel node was accidentally a subclass of `Equality` node, IMHO it is considered as almost a bug. But someone depends on the behavior for now (see also #39288). Unfortunately that implicit `create_with` had an unwanted side effect to fail `or` with STI subclass relation #39956. This changes a way to suppress/override `type_condition`, from doing implicit `create_with` to excepting `type_condition` in `scope_for_create`, to fix the `or` issue #39956.
-
由 Ryuta Kamizono 提交于
Fixed the column type typo in the scaffold command for multi-database guide [ci skip]
-
由 Abhay Nikam 提交于
-
由 Eugene Kenny 提交于
Load plugin VERSION constant by default
-
由 Jonathan Hefner 提交于
For example, for a plugin like `my_plugin`, this makes the `MyPlugin::VERSION` constant available to all consumers by default. This commit also replaces the default generated test with a test that the developer is less likely to delete.
-
由 Eugene Kenny 提交于
Follow naming conventions in generated plugin test
-
由 Eileen M. Uchitelle 提交于
Adds db:migrate:redo:NAME support for multidbs
-
由 Eileen M. Uchitelle 提交于
Prioritize db_config for current env when resolving config.
-
- 31 7月, 2020 9 次提交
-
-
由 Jonathan Hefner 提交于
This commit ensures that a generated test file like "foo/bar_test.rb" defines the class `Foo::BarTest` rather than `Foo::Bar::Test`.
-
由 Vipul A M 提交于
Document ActiveModel errors methods
-
由 Vipul A M 提交于
Remove reference to deleting sessions via nil [ci-skip]
-
由 Vipul A M 提交于
Remove confusing phrase from docs [ci skip]
-
由 Vipul A M 提交于
Update wording for cookies [ci-skip]
-
On current master with multiple DBs configured, calling db:migrate:redo fails when trying to run db:rollback. Before: ``` » bin/rails db:migrate:redo rake aborted! You're using a multiple database application. To use `db:rollback` you must run the namespaced task with a VERSION. Available tasks are db:rollback:primary and db:rollback:secondary. Tasks: TOP => db:rollback (See full trace by running task with --trace) ``` After: ``` » bin/rails db:migrate:redo rake aborted! You're using a multiple database application. To use `db:migrate:redo` you must run the namespaced task with a VERSION. Available tasks are db:migrate:redo:primary and db:migrate:redo:secondary. Tasks: TOP => db:migrate:redo (See full trace by running task with --trace) ``` Running the namespaced version: ``` » bin/rails db:migrate:redo:secondary == 20200728162820 CreateAnimals: reverting ==================================== -- drop_table(:animals) -> 0.0025s == 20200728162820 CreateAnimals: reverted (0.0047s) =========================== == 20200728162820 CreateAnimals: migrating ==================================== -- create_table(:animals) -> 0.0028s == 20200728162820 CreateAnimals: migrated (0.0029s) =========================== ```
-
由 Guillermo Iguaran 提交于
Fix unusual line terminators [ci skip]
-
由 Chirag Shah 提交于
-
由 Eileen M. Uchitelle 提交于
Add docs for abstract class generators
-
- 30 7月, 2020 11 次提交
-
-
由 eileencodes 提交于
Adds documentation for https://github.com/rails/rails/pull/39866
-
由 Eugene Kenny 提交于
Fix wrong attributes being set in transactions savepoint test.
-
由 Guo Xiang Tan 提交于
-
由 Ryuta Kamizono 提交于
Fixed typo AnimalsRecrd -> AnimalsRecord [ci skip]
-
由 Abhay Nikam 提交于
-
由 Vinicius Stock 提交于
* Reduce allocations in transition_table * Use predicate symbol? instead of is_a?
-
由 Ryuta Kamizono 提交于
Clear Resolvers' cache after AVLogSubscriberTest tests
-
由 Yasuo Honda 提交于
Addresses the build failure below: https://buildkite.com/rails/rails/builds/70853#29647167-4db2-4810-810e-d2c3a4e6dcf8 * This pull request addresses this error. ``` $ bin/test test/template/log_subscriber_test.rb test/template/test_case_test.rb -n "/^(?:AVLogSubscriberTest#(?:test_render_collection_template)|ActionView::HelperInclusionTest#(?:test_helper_class_that_is_being_tested_is_always_included_in_view_instance))$/" --seed 54118 Run options: -n "/^(?:AVLogSubscriberTest#(?:test_render_collection_template)|ActionView::HelperInclusionTest#(?:test_helper_class_that_is_being_tested_is_always_included_in_view_instance))$/" --seed 54118 .E Error: ActionView::HelperInclusionTest#test_helper_class_that_is_being_tested_is_always_included_in_view_instance: ActionView::Template::Error: undefined method `_test__customer_erb___3224798146126036163_10260' for #<#<Class:0x00005653f1b35768>:0x00005653f1b348e0> /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/base.rb:276:in `_run' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:182:in `block in render' /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:205:in `instrument' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:384:in `instrument_render_template' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:180:in `render' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/collection_renderer.rb:186:in `block in collection_with_template' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/collection_renderer.rb:66:in `block in each_with_info' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/collection_renderer.rb:66:in `each' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/collection_renderer.rb:66:in `each_with_info' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/collection_renderer.rb:177:in `each' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/collection_renderer.rb:177:in `map' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/collection_renderer.rb:177:in `collection_with_template' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/collection_renderer.rb:159:in `block (2 levels) in render_collection' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb:21:in `cache_collection_render' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/collection_renderer.rb:158:in `block in render_collection' /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:203:in `block in instrument' /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications/instrumenter.rb:24:in `instrument' /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:203:in `instrument' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/collection_renderer.rb:144:in `render_collection' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/collection_renderer.rb:116:in `render_collection_with_partial' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/renderer.rb:75:in `render_partial_to_object' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/renderer.rb:27:in `render_to_object' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/renderer.rb:22:in `render' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/helpers/rendering_helper.rb:38:in `block in render' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/base.rb:306:in `in_rendering_context' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/helpers/rendering_helper.rb:34:in `render' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/test_case.rb:205:in `render' /home/yahonda/src/github.com/rails/rails/actionview/test/template/test_case_test.rb:126:in `render_from_helper' /home/yahonda/src/github.com/rails/rails/actionview/test/fixtures/test/_from_helper.erb:1:in `__home_yahonda_src_github_com_rails_rails_actionview_test_fixtures_test__from_helper_erb___900298654238864924_10340' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/base.rb:276:in `_run' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:182:in `block in render' /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:205:in `instrument' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:384:in `instrument_render_template' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/template.rb:180:in `render' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/partial_renderer.rb:285:in `block in render_partial_template' /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:203:in `block in instrument' /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications/instrumenter.rb:24:in `instrument' /home/yahonda/src/github.com/rails/rails/activesupport/lib/active_support/notifications.rb:203:in `instrument' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/partial_renderer.rb:280:in `render_partial_template' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/partial_renderer.rb:271:in `render' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/renderer.rb:84:in `render_partial_to_object' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/renderer.rb:27:in `render_to_object' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/renderer/renderer.rb:22:in `render' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/helpers/rendering_helper.rb:38:in `block in render' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/base.rb:306:in `in_rendering_context' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/helpers/rendering_helper.rb:34:in `render' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/test_case.rb:205:in `render' /home/yahonda/src/github.com/rails/rails/actionview/lib/action_view/test_case.rb:122:in `render' /home/yahonda/src/github.com/rails/rails/actionview/test/template/test_case_test.rb:136:in `block in <class:HelperInclusionTest>' bin/test test/template/test_case_test.rb:132 Finished in 0.076637s, 26.0970 runs/s, 39.1454 assertions/s. 2 runs, 3 assertions, 0 failures, 1 errors, 0 skips $ ``` Refer #36189 for the similar fix
-
由 Eugene Kenny 提交于
Autosave collection associations exactly once
-
由 Eileen M. Uchitelle 提交于
Generate abstract class when generating scaffold in another database
-
由 eileencodes 提交于
This PR ensures that when you're generating a scaffold or model and that model should belong to another database it will create an abstract class if it doesn't already exist. The new abstract class will ensure that the new model inherits from that class, but will not be deleted if the scaffold is deleted. This is because Rails can't know if you have other models inheriting from that class so we don't want to revoke that if the scaffold is destroyed. If the abstract class already exists it won't be created twice. If the options for `parent` are set, the generator will use that as the abstract class instead of creating one. The generated abstract class will add the writing connection automatically, users need to add the reading connection themselves as Rails doesn't know which is the reading connection. Co-authored-by: NJohn Crepezzi <john.crepezzi@gmail.com>
-
- 29 7月, 2020 4 次提交
-
-
由 Ryuta Kamizono 提交于
The model global `read_attribute_for_validation` is not fit for some validators (specifically for numericality validator). To allow per-validator customization for attribute value, it extracts `read_attribute_for_validation` in `EachValidator`.
-
由 Eugene Kenny 提交于
Correct engine generator docs
-
由 Eugene Kenny 提交于
Use standard config/application.rb in plugin dummy
-
由 Jonathan Hefner 提交于
The `config/application.rb` file of a plugin test dummy app should be the same as in a standard Rails app, with the exception of an additional `require` statement to load the plugin itself. However, prior to this commit, the plugin generator used a specialized template for a portion of this file, which tended to drift out-of-sync with the standard app generator's template. Specifically, this drift could result in missing `require` statements of newer Rails frameworks when the plugin generator was run with any `--skip-xxxx` option. This commit changes the plugin generator to insert its additional `require` statement into the standard `config/application.rb` file generated by the app generator.
-
- 28 7月, 2020 6 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
`type_for_attribute` was added (extracted from `column_for_attribute`) in `ModelSchema` at c93dbfef, I sometimes had expected that both `column_for_attribute` and `type_for_attribute` exists in `ModelSchema`, but `column_for_attribute` had existed in `AttributeMethods` even though it's not very relevant to attribute methods (getting column object is no longer useful for most end users since type object is separated from column object, by the way). So I've moved `column_for_attribute` to the same place with `type_for_attribute` to less confusion a bit.
-
由 Eugene Kenny 提交于
Followup to 17a4ec1c.
-
由 Eugene Kenny 提交于
Move Path::Pattern factories into test helper
-
由 Eugene Kenny 提交于
Fix flakey test due to non-deterministic order
-
由 Daniel Colson 提交于
`Pattern#from_sting` was introduced in bb207ea7 to support creating patterns from strings in tests (removing a conditional in the initialize method that had been there only for the sake of those tests). `Pattern#build` was introduced in 947ebe9a, and was similarly used only in tests. My understanding is that [`Mapping#path`][path] is the only place where we initialize a `Path::Pattern` in library code. Since these two methods appear to be used only in tests, this commit moves them out of the class and into a test helper. My reasoning for doing this is that I am doing some performance work that may involve a modification to how `Path::Pattern`s get initialized, and I will have more confidence in that work if I know for sure that these methods are test helpers that can be modified freely. [path]: https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/routing/mapper.rb#L192-L194
-