diff --git a/CHANGELOG.md b/CHANGELOG.md index b0424c0..587e713 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Add Ruby 3.2 to build matrix (#82) * Bump actions versions to v4 (#86) * Add Ruby 3.3, drop Ruby 2.6 from build matrix (#87) +* Allow filters to use any filter type (#85) (@optijon) ## 0.8.0 * Remove usage of `Redis.current` (#78) diff --git a/lib/redis/time_series/filters.rb b/lib/redis/time_series/filters.rb index 9eda24d..3eb4c89 100644 --- a/lib/redis/time_series/filters.rb +++ b/lib/redis/time_series/filters.rb @@ -124,7 +124,7 @@ def validate! end def valid? - !!filters.find { |f| f.is_a? Equal } + !!filters.find { |f| f.is_a?(Equal) || f.is_a?(AnyValue)} end def to_a diff --git a/spec/redis/time_series/filters_spec.rb b/spec/redis/time_series/filters_spec.rb index 20c2f67..28f28c5 100644 --- a/spec/redis/time_series/filters_spec.rb +++ b/spec/redis/time_series/filters_spec.rb @@ -93,6 +93,12 @@ it { is_expected.not_to be_valid } end + context 'with any value filter' do + let(:value) { 'foo=(bar,baz)' } + + it { is_expected.to be_valid } + end + context 'with no filters' do let(:value) { nil }