Commit Graph

77569 Commits

Author SHA1 Message Date
Jason York
7bd9603778 Add ActiveSupport::Duration conversion methods 2020-08-26 09:35:09 -05:00
Ryuta Kamizono
3ddf6b66bc Lazy allocate error message string in check_if_method_has_arguments! 2020-08-26 11:29:57 +09:00
Daniel Colson
0ed1372c42
Merge pull request #40057 from composerinteralia/requiring-config-initializers
Add note to avoid requiring config/initializers [ci skip]
2020-08-25 20:55:46 -04:00
Daniel Colson
f976dec24b
Add note to avoid requiring config/initializers
[ci skip]

Closes #40021

I began this commit by adding an additional note about explicitly
requiring initializers. `config/intializers` are loaded with `load`
rather than `require` (and always have been, since they were introduced
way back in c6d6082562). So explicitly requiring them can be problematic
if they are not idempotent.

But @p8 pointed out that it is a bit awkward to have 3 notes and one tip
larger than the actual text in this section.

This commit now also reworks 2 of the notes and the tip into additional
paragraphs in the main text. The benefits of the new version I see:

- We now explicitly say that the initializers are loaded by sort order
- We now start with the ideal way to deal with dependent initializers,
  then follow with a couple warnings. We used to lead with what not to
  do, which I think was a bit confusing.
- The language around subdirectories is much simpler (mentioning that
  subdirectories can be used for organizing seemed unnecessary to me -
  that is true of subdirectories in general, and doesn't have any
  specific connection to initializers)

This commit does not change the opening paragraph or the note about when
to use `after_initialize` instead, although it does reformat them.
2020-08-25 20:25:46 -04:00
Rafael França
ee6ee11b01
Merge pull request #40033 from dpep/deep-dup
deep dup optimization
2020-08-25 20:25:09 -04:00
Rafael Mendonça França
7066f08cd8
Whitespaces ✂️ 2020-08-25 23:52:12 +00:00
Rafael Mendonça França
e71d09bf82
Fix typo 2020-08-25 22:03:50 +00:00
Rafael Mendonça França
14bd328273
Copy-edit the querying guide 2020-08-25 22:02:51 +00:00
Rafael França
e6c61c54bb
Merge pull request #39406 from vipulnsward/ar-bookstore-model
Changes over AR Querying guide making use of Bookstore example
2020-08-25 17:58:32 -04:00
Eugene Kenny
34c54f9668
Merge pull request #40104 from p8/happy-human
Rename horrible and dirty to puzzled and confused in test models
2020-08-25 22:32:18 +01:00
Rafael França
bdd00fb29d
Merge pull request #40103 from adrianna-chang-shopify/same-site-protection-proc
Allow procs for config.action_dispatch.cookies_same_site_protection
2020-08-25 15:43:49 -04:00
Jack McCracken
7459672fb0 Allow a proc to be used in addition to a static value for cookies_same_site_protection
Add documentation of Proc usage for SameSite property to configuring.md

Address PR comments

Co-authored-by: Adrianna Chang <adrianna.chang@shopify.com>
2020-08-25 14:33:48 -04:00
Rafael Mendonça França
c774da7ebe
Only try to check constraints on databases that supports it
MySQL <= 5.7 doesn't support so we should not try to check them.
2020-08-25 17:54:55 +00:00
Petrik
504a9d5010 Rename horrible and dirty to puzzled and confused in test models
In 7f938ca the test model `Man` was renamed to `Human`. Maybe this is a
good time to also change `horrible_human` and `dirty_human` to
`happy_human` and `confused_human`.

While this change is mostly cosmetic change, the phrase "dirty man" has
a negative meaning.

The adjectives "confused" and "puzzled" were chosen because they are
used for defining associations with errors.
2020-08-25 18:32:52 +02:00
Rafael França
acaa546026
Merge pull request #40092 from fleck/dont-push-assets-and-skip-preload-for-defer-javascript
don't add preload headers for deferred scripts and add nopush
2020-08-24 14:53:51 -04:00
Daniel Colson
d5fb2ceeb2
Merge pull request #40099 from abhaynikam/document-other-than-accept-proc-symbol
Documents other_than option for numericality validation [skip ci]
2020-08-24 12:32:17 -04:00
Abhay Nikam
714f8c8068 Documents other_than option also accepts the proc or a symbol for numericality validation [skip ci] 2020-08-24 21:27:45 +05:30
Ryuta Kamizono
35a103a96e Build only join_sources in references_eager_loaded_tables?
Since other part in `arel` is not necessary for that.
2020-08-24 18:44:46 +09:00
Ryuta Kamizono
f5901883c3
Merge pull request #40097 from Shopify/ar-reorder-uniq
Call uniq! on the `reorder` arguments.
2020-08-24 18:09:53 +09:00
Jean Boussier
ffb6fa0933 Call uniq! on the reorder arguments.
Before 29874cc4e220edadfdf50ba93db57d2df396e395 the order values
would be deduplicated when the SQL query is generated, but now
it has to be eager.
2020-08-24 10:54:08 +02:00
Ryuta Kamizono
aa4a1a82b9 Refactor references_eager_loaded_tables? to fewer allocation 2020-08-24 16:29:04 +09:00
Ryuta Kamizono
2a29dde552
Merge pull request #39685 from kamipo/store_full_class_name
Support storing demodulized class name for polymorphic type
2020-08-24 14:48:24 +09:00
Eugene Kenny
f22dd39cb2 Remove config class attribute from TestFixtures
This was added in 6223e2067608aa7fa2ecd2c50e2db74f26ad5914 to allow
`table_name_prefix`, `table_name_suffix`, and `pluralize_table_names` to
be injected instead of always being read from `ActiveRecord::Base`. It
was never documented, and after 336783ad96dbcc3f84a11069e004ea1268b051f4
and 0c843640b49e9ca41232d1402f26780e4f511275 setting it has no effect.
2020-08-23 23:18:59 +01:00
Ryuta Kamizono
0e7e897a97 Avoid redundant table alias if arel_table.name == table_name 2020-08-24 05:17:25 +09:00
Ryuta Kamizono
29874cc4e2 Deduplicate multiple values when assigning 2020-08-24 05:11:41 +09:00
Ryuta Kamizono
94bf4c097f
Merge pull request #40094 from soartec-lab/add_delete_by_into_skipping_callback_methods
Add `#delete_by` into skipping callback methods [skip ci]
2020-08-24 00:37:57 +09:00
soartec-lab
bf2a14cde1 Add #delete_by into skipping callback methods [skip ci] 2020-08-24 00:26:58 +09:00
Jonathan Fleckenstein
0b65e23978 Allow callers to remove nopush 2020-08-23 09:53:42 -04:00
Ryuta Kamizono
29d46b2712
Merge pull request #40093 from soartec-lab/add_destroy_by_into_trigger_callbacks_methods
Add `#destroy_by` into trigger callbacks methods [skip ci]
2020-08-23 21:47:30 +09:00
soartec-lab
527bc1085e Add #destroy_by into trigger callbacks methods [skip ci] 2020-08-23 20:36:02 +09:00
Eugene Kenny
0d0eb93b16 Add missing require for Enumerable#index_with
Followup to 0adcec49541aac069600202ed5f83c8ef6f2197e.
2020-08-23 09:17:53 +01:00
Ryuta Kamizono
62cfbdf36e Support storing demodulized class name for polymorphic type
This is an alternative of #29722.

Before Rails 6.1, storing demodulized class name is supported only for
STI type by `store_full_sti_class` class attribute.

Now `store_full_class_name` class attribute can handle both STI and
polymorphic types.

Closes #29722.

See also #29601, #32048, #32148.
2020-08-23 16:04:29 +09:00
Jonathan Fleckenstein
033ac18590 don't preload for defered scripts and disable push 2020-08-22 20:59:29 -04:00
Jonathan Hefner
97066dac7a
Merge pull request #40086 from brandondrew/patch-1
consistent syntax for items in list
2020-08-22 18:13:53 -05:00
Jonathan Hefner
680db1df11
Merge pull request #40087 from the-spectator/doc_fix_configurable
Corrects the documentation for AciveSupport::Configurable config class [ci skip]
2020-08-22 16:35:20 -05:00
Akshay Birajdar
07e6270a27 Corrects the config object class [ci skip] 2020-08-23 00:53:22 +05:30
Brandon Zylstra
b35935fa15
consistent syntax for items in list
The majority of items in this list are clauses that complete the sentence "...you will know...".  But the 2nd item was an independent question with its own question mark, and the other changed one had the syntax of a question despite lacking a question mark.
2020-08-22 12:20:43 -04:00
Jonathan Hefner
ab4ab09066
Merge pull request #40079 from chiraggshah/syntax-highlighting-improvements
Formats code blocks for better syntax highlighting [ci skip]
2020-08-21 07:25:45 -05:00
Chirag
84d6a0e568 Formats code blocks for better syntax highlighting 2020-08-21 15:47:32 +05:30
Jonathan Hefner
568e177763
Merge pull request #40080 from chiraggshah/patch-3
Fix minor formatting issue [ci skip]
2020-08-20 19:53:17 -05:00
Chirag Shah
3d94da3f0e
Fix minor formatting issue 2020-08-21 05:28:38 +05:30
Carlos Antonio da Silva
65c6f70300
Merge pull request #40047 from mehagar/plugins_docs
Fix markdown syntax error in docs [ci skip]
2020-08-20 18:00:44 -03:00
Rafael França
352126936d
Merge pull request #40075 from gregoriokusowski/bump-web-console
Bump minimum web-console version to 4.0.3
2020-08-20 11:32:01 -04:00
Gregorio Kusowski
ee117650e1 Bump minimum web-console version to 4.0.3 2020-08-20 10:45:00 +02:00
Ryuta Kamizono
b5dac96b59
Merge pull request #40072 from nathanallen/fix-datetime-select-defaults-docs
fix documented default values for datetime_select view helper

[ci skip]
2020-08-20 09:42:01 +09:00
nathanallen
cd15412e5a fix documented default values for datetime_select view helper 2020-08-19 16:35:42 -07:00
Aaron Patterson
397693a5ea
Merge pull request #26445 from dracos/multiparty
Correctly wrap inline attachments.
2020-08-19 10:10:36 -07:00
Prem Sichanugrist
35eb8c4e2c
Merge pull request #39591 from JuanitoFatas/web-console-settings
[Guides] Update web_console settings to use allowed_ips
2020-08-20 00:16:20 +09:00
Ryuta Kamizono
05aaf92047
Merge pull request #40065 from mikong/api-doc/fix-default-index-name
Fix generated default index names in API doc [ci skip]
2020-08-19 23:41:24 +09:00
mikong
d8115ba5c7
Fix generated default index names in API doc [ci skip] 2020-08-19 21:07:20 +08:00