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

Added Sum ArrayFilter with 2 different options #618

Merged
merged 4 commits into from
Jan 8, 2024

Conversation

cpriestland
Copy link
Contributor

Added "Sum" ArrayFilter so that others can use it also.

2 options:

  • Can include an argument to indicate which member to Sum on an array of objects
  • No argument which will attempt to Sum the array items value

Tests included with Pull Request which check both of these scenario's

We use Fluid quite a lot at TemplateTo and hope you don't mind us putting our link in your UsedBy section, Fluid can be used by our users as well when building out their templates.

@cpriestland
Copy link
Contributor Author

@hishamco Thanks for approving this, is there an idea of when this could be merged as we require the functionality? Thanks

@sebastienros
Copy link
Owner

Would you mind adding the same tests as in Shopify Liquid to ensure everything behaves as the specs?
https://github.com/Shopify/liquid/blob/f5ed5404b5ba04c7010d4f37ca2928bb6fa925a2/test/integration/standard_filter_test.rb#L952-L1052

@cpriestland
Copy link
Contributor Author

Thanks for your reply @sebastienros I have added the tests as suggested

@sebastienros sebastienros merged commit 74cb742 into sebastienros:main Jan 8, 2024
1 check passed
@hishamco
Copy link
Collaborator

hishamco commented Jan 8, 2024

Thanks for your contribution @cpriestland

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