- 30 7月, 2020 6 次提交
-
-
由 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 7 次提交
-
-
由 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
-
由 Eugene Kenny 提交于
Add back support for other syntax highlighting [skip-ci] Co-authored-by: NJonathan Hefner <jonathan@hefner.pro>
-
- 27 7月, 2020 8 次提交
-
-
由 Jonathan Hefner 提交于
Example failure: https://buildkite.com/rails/rails/builds/70840#d213df74-a2e6-45e5-8302-d75a6c31f700/1021-1033 The test's assertion expects the authors to be ordered by ID, but that order is not guaranteed without an explicit sort.
-
由 Philip Müller 提交于
Engines are not applications, indeed 'Application < Engine', so it's the other way round. The difference can be confusing anyway, so we should make sure the documentation is clear.
-
由 Ryuta Kamizono 提交于
Similar with #39463.
-
由 Ryuta Kamizono 提交于
Originally #39882 is intended to remove `decorate_matching_attribute_type` but leave `decorate_attribute_type` at that point, but in the disscussion in #39882, to demonstrate removing `AttributeDecorators` module, I've removed all decoration methods. I wrote user-defined type decoration as inline, I wasn't sure that is valid (meaningful) usage (that is a reason why I wasn't in a hurry to remove that method), as I said at https://github.com/rails/rails/pull/39882#discussion_r457750898. In #39897 and #39902, `enum` also need to support user-defined type decoration, so I've decided to add back `decorate_attribute_type` as before #39882.
-
由 Eugene Kenny 提交于
touch parent model when an attachment is purged
-
由 Victor Perez Rodriguez 提交于
Currently `delete` is used on the `purge` and `purge_later` methods, that prevent any callbacks to be triggered which causes the parent model to not be updated when an attachment is purged. This behaviour cause issues on some caching strategies as reported here: https://github.com/rails/rails/issues/39858 Changes: * Add `record&.touch` on `attachment#purge` * Add `record&.touch` on `attachment#purge_later` * Remove extra blank line on attachment.rb * Add tests which are failing before this change and pass after the change
-
由 Gerard (Gerry) Caulfield 提交于
When using Rouge's Console lexer it expects all ignored line breaks to be proceeded by a backslash. In this code block as we are switching to Mysql's command line which doesn't need a backslash. This leads to the lexer breaking and all the lines ending up in a confusing mess. However the sql syntax actually works much better for this block anyway. This line here shows why what we were trying to do wouldn't work with Rouge: https://github.com/rouge-ruby/rouge/blob/844c0eeddf7626605fa04b901df6c15c953811d6/lib/rouge/lexers/console.rb#L106
-
由 Gerard (Gerry) Caulfield 提交于
We recently switched to use Rouge for syntax highlighting in the guides, but in doing so we dropped support for highlighting the following syntaxes, which are used in the guides: apache diff json markdown nginx scss xml There was also css and the "javascript" alias, but @eugeneius already addressed these two. They syntaxes were all being converted to "plaintext". This change allows all the lexers mentioned above as well as any other lexers available through Rouge. We have deliberately decided to not support passing rougue custom lexer options from the code fences. Instead any lexer options that are needed can be set by adding an entry to the lexer_language case statement. This should lead to more consistency in formatting and gives us more control over what Rogue options are allowed.
-
- 26 7月, 2020 6 次提交
-
-
由 Eugene Kenny 提交于
Fix path_parameters key type inconsistency in ActionController::TestCase
-
由 Eugene Kenny 提交于
Fix option not being passed with fetch_multi
-
由 Rajesh Sharma 提交于
In redis cache store, options to `fetch_multi` are passed correctly to `write_multi` but not to `read_multi`. This causes cache always to be missed when passing `namespace` option to it.
-
由 Eugene Kenny 提交于
prevents redundant memcached compression
-
由 maxgurewitz 提交于
- Disables Dalli compression in MemCacheStore. - Fixes issue where redundant compression in Dalli can cause values to either be compressed twice, or compressed when they fall below the specified compression threshold.
-
由 Vitalii Khustochka 提交于
If request format is JSON, keys are converted to Strings, so we have to convert them to Symbols.
-
- 25 7月, 2020 9 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Eugene Kenny 提交于
Build symbols descending from stars with regexp
-
由 Ryuta Kamizono 提交于
`attr.name` is already normalized as a string and alias resolved. Ref #39881.
-
由 Daniel Colson 提交于
Before this commit we initialized all Symbols with the default regexp, then later on reassigned any symbols descending from stars with either their regexp from `@requirements` or the default greedy regexp. With this commit we initialize all Symbols descending from Stars with the greedy regexp at parse time. This allows us to get rid of the star branch in path/pattern, since any regexps from `@requirements` will already have been set in the symbol branch of this code. This is essentially an alternate version of #38901. Getting rid of the extra branch makes some performance work I am doing a bit easier, plus it saves us a few method calls. Also the constant saves us from creating the same regexp multiple times, and it is nice to give that regexp a name.
-
由 Ryuta Kamizono 提交于
Fix argument naming in `AbstractStore#set_cookie`
-
由 Marc Rohloff 提交于
The signature in Rack https://github.com/rack/rack/blob/master/lib/rack/session/abstract/id.rb#L415 expects a response as the second argument
-
由 Ryuta Kamizono 提交于
-
由 Eugene Kenny 提交于
Add label attribute to <option> from include_blank
-
由 Jonathan Hefner 提交于
The `:include_blank` option of various `<select>`-related helpers causes an `<option>` element with no content to be rendered. However, the [HTML spec] says that unless an `<option>` element has a `label` attribute (which must be non-empty), its content must be "Text that is not inter-element whitespace." In #24923, this issue was addressed for `select_tag` by adding a `label` attribute to the `<option>`. This commit addresses the issue in the same manner for `FormBuilder#select` and various date / time select helpers. [HTML spec]: https://html.spec.whatwg.org/multipage/form-elements.html#the-option-element
-