Commit c0a87f8
committed
drop unnecessary load_schema statements
Before rails 7.2:
All of this data was set in `load_schema!` so we needed to ensure
the schema was loaded to access _virtual_includes or _virtual_arel.
Same may be the case for has_attribute?
After rails 7.2:
It may have always been the case, but at least for the rails methods
we do not need to ensure the schema is loaded.
For our 2 class level variables, we now load _virtual_arel without
load_schema. So there is no reason to wait for schema_load.
- virtual_attribute?:
- has attribute loads the schema if necessary
- column_for_attribute loads the schema if necessary
- attribute_supported_by_sql?
- has_attribute loads the schema if necessary
- virtual_attribute? loads the schema indirectly (by 2 internal methods)
- _virtual_arel is populated on class load, not schema load
- virtual_includes
- _virtual_includes is populated on class load, not schema load1 parent 25b9b53 commit c0a87f8
File tree
3 files changed
+0
-3
lines changed- lib/active_record
- virtual_attributes
3 files changed
+0
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
0 commit comments