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

🤖 Convert Active Record Relation to Array in Products Controller #651

Conversation

sentry-autofix[bot]
Copy link
Contributor

@sentry-autofix sentry-autofix bot commented Jan 3, 2025

👋 Hi there! This PR was automatically generated by Autofix 🤖

This fix was triggered by Kosty Maleyev

Fixes REACT-594

In the products_controller.rb, the way reviews are fetched for a product has been modified. Previously, the reviews were fetched as an Active Record Relation but now they are explicitly converted to an array by using .to_a. This change can improve performance in certain contexts by loading all review records immediately from the database rather than keeping them as a relation, which may delay the query execution until they are iterated over.

If you have any questions or feedback for the Sentry team about this fix, please email autofix@sentry.io with the Run ID: 2843.

Copy link

vercel bot commented Jan 3, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
empower ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2025 0:21am

Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 34.13%. Comparing base (c1cd06d) to head (d39791c).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #651   +/-   ##
=======================================
  Coverage   34.13%   34.13%           
=======================================
  Files          37       37           
  Lines         920      920           
  Branches      111      111           
=======================================
  Hits          314      314           
  Misses        589      589           
  Partials       17       17           
Flag Coverage Δ
api 6.59% <ø> (ø)
frontend 54.75% <ø> (ø)
Components Coverage Δ
checkout_module 6.59% <ø> (ø)
product_component 56.41% <ø> (ø)

@realkosty realkosty marked this pull request as ready for review January 3, 2025 00:20
@realkosty realkosty merged commit b9e86af into master Jan 3, 2025
8 checks passed
@realkosty realkosty deleted the autofix/convert-active-record-relation-to-array-in-products-controller/Q7tMBW branch January 3, 2025 00:20
realkosty added a commit that referenced this pull request Jan 7, 2025
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.

1 participant