- 04 8月, 2020 3 次提交
-
-
由 Lawrence Chou 提交于
Closes #37411.
-
由 Eugene Kenny 提交于
These formats were added in c329d323 and bcf370d6, respectively.
-
由 Eugene Kenny 提交于
fix misleading variant test
-
- 03 8月, 2020 5 次提交
-
-
由 Eugene Kenny 提交于
improve active record validation docs [ci skip]
-
由 Eileen M. Uchitelle 提交于
The abstract parent class file generated via generator should not be pluralized
-
由 Manuel Meurer 提交于
-
由 Ryuta Kamizono 提交于
Avoid implicit `create_with` for `StiClass.all`
-
由 Abhay Nikam 提交于
Currently, the file generated via the generator is pluralized but the parent class is singluar. example: bundle exec rails g scaffold Pet name:string --database=animals The above command should generate: apps/models/animals_record.rb but the pets model would inherit from: `AnimalRecord` as `"animals".classify` would be `Animal` This will throw the `uninitialized constant AnimalRecord Did you mean? AnimalsRecord` error.
-
- 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 12 次提交
-
-
由 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
-
由 Victor Perez Rodriguez 提交于
This commit fixes the "resized variation of BMP blob" test. By default `create_file_blob` use "image/jpeg" as content type, since this test does not specify the correct `content_type` for a `*.bmp` image ("image/bmp") the `ActiveStorage::Variant#specification` consider the blob as a web image which causes the variant to return a `*.bmp` URL and a "BMP" type, this is an incorrect behavior since if you upload a `*.bmp` image the variant will have a PNG format with "image/png" as content type. After this change the test will cover the current activestorage behavior. Changes: * Specify correct `content_type` on "resized variation of BMP blob" test. * Change asserts to cover the current activestorage behavior.
-
由 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 2 次提交
-
-
由 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
-