Commit Graph

79513 Commits

Author SHA1 Message Date
Alex Ghiculescu 0fba70c082 Clarify when `enctype="multipart/form-data"` gets added to forms [docs]
As noted in https://github.com/rails/rails/issues/41632 the docs for this are incorrect. The `enctype` attribute is automatically added anytime you make a form with a `file_field`.

Resolves https://github.com/rails/rails/issues/41632

Update actionview/lib/action_view/helpers/form_helper.rb

Co-authored-by: Petrik de Heus <petrik@deheus.net>
2021-03-10 13:09:46 -06:00
eileencodes fc20050ea6
Merge branch 'fix_database_yml_example_in_mutltiple_databases_rails_guide' into main 2021-03-10 10:44:19 -05:00
ryu39 0bbc293b77
Fix database.yml example in multiple databases Rails Guide
* Change :user to :username
* Add :password
2021-03-10 10:44:12 -05:00
Eileen M. Uchitelle 7240fb636b
Merge pull request #41560 from dmilburn/add-rails-development-hosts-env-variable
Add RAILS_DEVELOPMENT_HOSTS env variable
2021-03-10 10:34:44 -05:00
Ryuta Kamizono 4607f13c88 Use `serializable?` instead of `rescue ::RangeError` 2021-03-10 21:21:22 +09:00
Ryuta Kamizono 3b6461bb46 Fix between stringify enum values to return the expected result 2021-03-10 20:47:08 +09:00
Ryuta Kamizono 55d913d34c
Merge pull request #41648 from alkesh26/fixed-incorrect-changelog-output
[ci skip] corrected the output of maximum in ActiveSupport changelog
2021-03-10 19:23:50 +09:00
Xavier Noria 0f6a033798 Replaces references to internal AS::Dependencies attributes in the AS guide 2021-03-10 08:12:25 +01:00
Xavier Noria 482e081aaa Deletes AS::Dependencies.warnings_on_first_load 2021-03-10 07:55:29 +01:00
alkeshghorpade 40770b6878 corrected the output of maximum in ActiveSupport changelog 2021-03-10 10:57:53 +05:30
Debbie Milburn 03aa08526a
Merge branch 'main' into add-rails-development-hosts-env-variable 2021-03-09 11:59:11 -05:00
Xavier Noria dc7817cb42 Deletes logging from AS::Dependencies 2021-03-09 10:02:03 +01:00
Ryuta Kamizono df41acdad9
Merge pull request #41641 from kamipo/merge_select_values
Fix merging select values from a different model's relation
2021-03-09 16:38:15 +09:00
Ryuta Kamizono 7f3ea2181e Delegate `serializable?` to `subtype` on Enum
Since #41516, values on Enum are not always serializable.
2021-03-09 16:30:27 +09:00
Gannon McGibbon 603eb247a1
Merge pull request #41565 from gmcgibbon/engine_keeps
Add app concern and test keepfiles to generated engine plugins
2021-03-09 00:21:32 -05:00
Gannon McGibbon bf57e7ff9d Add app concern and test keepfiles to generated engine plugins 2021-03-09 00:04:29 -05:00
Ryuta Kamizono 6efe2b4900 Use `type.serializable?` in `unboundable?` 2021-03-09 09:23:44 +09:00
Ryuta Kamizono dc96825d44 Fix `number_to_human_size`'s result [ci skip] 2021-03-09 08:45:35 +09:00
Ryuta Kamizono ac6c4bde86 Fix merging select values from a different model's relation
Unlike order values, where/having clause, etc, select values lazily
evaluates the attribute name resolution until building arel.

If select values are merged from a different model's relation, those may
be incorrectly resolved as a column in a wrong table.

In that case, the attribute name resolution should be done before
merging those.
2021-03-09 08:12:28 +09:00
Ryuta Kamizono 982ed415be
Merge pull request #41640 from bradleypriest/arel-quoting
Quote the arguments passed to the Contains/Overlaps Arel nodes
2021-03-09 05:45:39 +09:00
Ryuta Kamizono f855139f3d
Merge pull request #41639 from ghiculescu/patch-2
Add docs for `insert_all` with scopes

[ci skip]
2021-03-09 05:36:53 +09:00
Bradley Priest 16e45de59e Quote the arguments passed to the new Contains/Overlaps node types to align with the behaviour of existing predicates 2021-03-09 08:05:17 +13:00
Alex Ghiculescu 08f3dfeaee
Add docs for `insert_all` with scopes
Adds docs for https://github.com/rails/rails/pull/38899

cc @kamipo
2021-03-08 10:52:04 -06:00
Xavier Noria 43a7f68ae3 Deletes AS::Dependencies::Blamable
This is an internal class which is no longer needed.
2021-03-08 17:10:42 +01:00
Ryuta Kamizono 90d0b42bd8
Merge pull request #41599 from kamipo/changelog_for_type_cast_enum_values
Add CHANGELOG entry for type casting enum values by the subtype
2021-03-08 17:13:34 +09:00
Ryuta Kamizono d9f6027587
Merge pull request #41577 from kamipo/avoid_extra_bind_allocation
Avoid extra `BindParam` allocation to generate placeholder in queries
2021-03-08 17:10:21 +09:00
Xavier Noria 3c90308b17 Deletes AS::Dependencies::ClassCache
This is an internal class which is no longer needed.
2021-03-08 07:54:28 +01:00
Xavier Noria 14d4edd7c3 Deletes AS::Dependencies::Reference
This is an internal class which is no longer needed.
2021-03-08 07:54:18 +01:00
Xavier Noria 0d523d8365 Drops support for classic mode
This starts a series of patches in which we drop classic mode. The final
result no longer has a const_missing callback, there is no hook/unhook,
and so on.

So, in this patch we remove the ability of configuring classic, but some
of the code that remains will be further refactored.
2021-03-08 05:30:11 +01:00
Jonathan Hefner 7762770805
Use stable branch for --edge option when possible
This alleviates the need to update the code when there is a new stable
branch (for example, as done in #41454).
2021-03-07 17:45:37 -05:00
Xavier Noria c431432f93 Add app/{helpers,models} to autoload_once_paths
The helpers of Action Text are added to a couple of non-reloadable
base classes:

  initializer "action_text.helper" do
    %i[action_controller_base action_mailer].each do |abstract_controller|
      ActiveSupport.on_load(abstract_controller) do
        helper ActionText::Engine.helpers
      end
    end
  end

Therefore, it does not make sense that they are reloadable themselves.

For the same price, we can also make the models non-reloadable, thus
saving parent applications from the unnecessary work of reloading this
engine.

We did this for turbo-rails as well.
2021-03-07 23:05:24 +01:00
Kasper Timm Hansen 7bc962fe99
Merge pull request #41635 from sunny/add-pointer-cursor-to-rescue-layout
Add pointer cursor to Exception layout
2021-03-07 20:57:07 +01:00
Ryuta Kamizono b881a646da Use `records.compact!` over `records.compact` in `excluding`
`"posts"."id" IS NOT NULL` is generated if `nil` is remained in
`records`.
2021-03-08 03:25:01 +09:00
Ryuta Kamizono 0f917da01a Remove unused accessors `left` and `right` on `DeleteStatement`
Use `relation` and `wheres` instead.
2021-03-08 03:07:25 +09:00
Ryuta Kamizono c48539ff94 Allow select statement node's initializer takes a table
Like other statement nodes does, related to 333f9b32.
2021-03-08 02:54:10 +09:00
Henrik Nyh 1c97c5b2c2
Autoloading docs: Grammar/style tweaks 2021-03-07 11:38:42 -05:00
Ryuta Kamizono cdbd8415f6
Merge pull request #41633 from ttanimichi/patch-1
[ci skip] Not `masked_authenticity_token` but `form_authenticity_token` should be a public API
2021-03-07 23:56:35 +09:00
Tsukuru Tanimichi 7c5c8f9e48
[ci skip] Not `masked_authenticity_token` but `form_authenticity_token` should be a public API
`form_authenticity_token` would be a public API because:

1. The usage of this method [is described in the guide](291a3d2ef2/guides/source/action_controller_overview.md (request-forgery-protection)) and already [many Rails users depend on this method](https://stackoverflow.com/questions/941594/understanding-the-rails-authenticity-token).
2. This method [is set as helper_method](291a3d2ef2/actionpack/lib/action_controller/metal/request_forgery_protection.rb (L97)) and called form ActionView. Inside the Rails components, it's already used as a public interface of ActionController.
2021-03-07 22:57:08 +09:00
Sunny Ripert 433f9707a1 Add pointer cursor to Exception layout 2021-03-07 14:57:03 +01:00
Ryuta Kamizono 1ccf4371a9
Merge pull request #41630 from jbampton/fix-spelling
chore: fix spelling
2021-03-07 18:40:59 +09:00
John Bampton abcb5f5050 chore: fix spelling 2021-03-07 18:09:45 +10:00
Abhay Nikam ddbf01c52e @rails/actiontext: depend on released @rails/activestorage 2021-03-06 11:32:44 -05:00
Xavier Noria ec4e71e49a
Merge pull request #41564 from gmcgibbon/remove_require_dependency_in_templates
Remove require_dependency from controller templates
2021-03-05 23:39:17 +01:00
Mark VanLandingham bece535c98
Add config.action_text.attachment_tag_name 2021-03-05 16:57:36 -05:00
Debbie Milburn 8c50571808 Add RAILS_DEVELOPMENT_HOSTS to allow adding authorized hosts for development
Co-authored-by: Josh Abernathy <joshaber@gmail.com>

Update railties/CHANGELOG.md

Co-authored-by: Gannon McGibbon <gannon@hey.com>

Update railties/lib/rails/application/configuration.rb

Co-authored-by: Gannon McGibbon <gannon@hey.com>

Use yield block to safely alter env variables

Remove trailing whitespace

Update railties/CHANGELOG.md wording

Co-authored-by: Marivaldo Cavalheiro <marivaldo@gmail.com>

Have comma separated list ignore spaces

Add missing comma
2021-03-05 14:03:37 -05:00
Christian Schmidt 6cd184ff0f
Use image/jpeg instead of non-standard image/jpg 2021-03-05 13:14:11 -05:00
Henrik Nyh c0140a7f89
CollectionProxy#any? docs: Mention "load.any?"
To go with the change in #41572.
2021-03-05 12:38:52 -05:00
Eileen M. Uchitelle 2c83532aec
Merge pull request #41608 from abhaynikam/fix-async-query-test
Fixes the asynchronous_queries_test.rb to use assert_equal over assert for comparison
2021-03-05 12:37:36 -05:00
Jonathan Hefner 2addbaf2e6
Merge pull request #41623 from NatMorcos/patch-2
[ci skip] Fix typos and grammatical errors in autoloading guide
2021-03-05 10:42:45 -06:00
Nat Morcos a5b8f00903 Fix typos and grammatical errors in autoloading guide 2021-03-05 11:36:55 -05:00