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

fix(result): Handle null additional_data in pagination_data #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

roramirez
Copy link

Fix pagination_data method to handle null additional_data

This patch addresses an issue in the pagination_data method within result.rb where an error occurred when additional_data was null. The fix modifies the method to safely navigate through potentially null values using Ruby's dig method, ensuring robustness and preventing errors in such scenarios.

Changes Made:

Updated pagination_data method in result.rb to safely access additional_data using dig.
Added test cases in result_spec.rb to validate behavior for both present and null additional_data.

Test Coverage:

Introduced new tests to cover scenarios where additional_data is both present and null.
Ensured that pagination_data correctly returns expected results or an empty hash when additional_data is null.
This change enhances the reliability of the pagination_data method, ensuring consistent behavior across various input conditions.

Fixes an issue where pagination_data would raise an error when
additional_data is null. This patch addresses the problem by safely
handling null values using dig. Additionally, test cases have been added
to validate this behavior.
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