Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ActiveRecord::getAttributeLabel() to override labels of deeply nested relations. #19912

Merged
merged 1 commit into from
Aug 26, 2023

Conversation

PowerGamer1
Copy link
Contributor

Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Fixed issues #19911

@what-the-diff
Copy link

what-the-diff bot commented Jul 25, 2023

PR Summary

  • Unified Behavior of ActiveRecord getAttributeLabel() Method
    The discrepancy in the getAttributeLabel() function from ActiveRecord has been addressed. Previously, primary model labels could override attributes of the related model only to a certain extent. Now, such overriding is permitted at all levels of relation nesting, enhancing consistency and predictability.

  • Optimization of GridView
    An issue in the GridView was corrected. In certain situations, it was needlessly calling the 'generateAttributeLabel()' function from the Model to create label values that were never employed. This unnecessary operation has been fixed, enhancing the GridView's efficiency and performance.

@PowerGamer1 PowerGamer1 force-pushed the fix19911 branch 2 times, most recently from 89e1b01 to 2d606a1 Compare July 26, 2023 13:16
@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +2.66% 🎉

Comparison is base (e916e9d) 46.29% compared to head (3e7a638) 48.95%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19912      +/-   ##
==========================================
+ Coverage   46.29%   48.95%   +2.66%     
==========================================
  Files         445      445              
  Lines       42810    42807       -3     
==========================================
+ Hits        19818    20957    +1139     
+ Misses      22992    21850    -1142     
Files Changed Coverage Δ
framework/db/BaseActiveRecord.php 77.58% <100.00%> (+3.15%) ⬆️

... and 28 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

framework/db/BaseActiveRecord.php Outdated Show resolved Hide resolved
@samdark
Copy link
Member

samdark commented Aug 18, 2023

@PowerGamer1 please resolve conflicts so I can hit the merge button. Thanks.

@samdark samdark merged commit 8532622 into yiisoft:master Aug 26, 2023
49 checks passed
@samdark
Copy link
Member

samdark commented Aug 26, 2023

👍

@samdark samdark added this to the 2.0.49 milestone Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants