fix: add default keyword argument to kredis extension attributes #1897
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
The arguments for many attributes in
Tapioca::Dsl::Compilers::Extensions::Kredis
are missing thedefault:
keyword argument defined in the kredis gem here. This is causing the following error whenever you generate the DSLs for an application that uses thedefault:
argument on a kredis attribute.Implementation
Added the
default:
keyword argument to all of the following kredis attribute methods:kredis_string
kredis_integer
kredis_decimal
kredis_datetime
kredis_flag
kredis_float
kredis_json
kredis_list
kredis_unique_list
kredis_set
kredis_counter
kredis_hash
kredis_boolean
Tests
I did not add new tests for this change as there don't appear to be existing tests for any of the other optional arguments here and this argument would not meaningfully change the DSL output (just allows it to not error when the
default:
argument is provided). Willing to add tests for this if needed -- leaning on the side of following the existing pattern here.