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

Use ActiveRecord relation for Spree::Shipment#line_items #2886

Merged
merged 1 commit into from
Oct 10, 2018

Conversation

spaghetticode
Copy link
Member

The original plain ruby instance method has been replaced by an ActiveRecord
has_many relation. This pure SQL solution should improve a bit performances
and allow to add further relations using has_many ... through: line_items.

The original plain ruby instance method has been replaced by an ActiveRecord
`has_many` relation. This pure SQL solution should improve a bit performances
and allow to add further relations using `has_many ... through: line_items`.
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes total sense, thanks!

Just for reference it was added here and I think it has been done not noticing that, transitioning from that complex method content that requires ruby to the simpler one, we could have moved that responsibility to ActiveRecord. 👍

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Thank you.

@kennyadsl kennyadsl merged commit 606b30f into solidusio:master Oct 10, 2018
@kennyadsl kennyadsl deleted the shipment_has_many_line_items branch October 10, 2018 10:23
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.

3 participants