Skip to content

Commit dd44feb

Browse files
Adding condition when spliting filter_params to prevent issue
1 parent b134c8f commit dd44feb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## v0.2.0 - 2019-08-01
8+
### Fixed
9+
- Adding condition when spliting filter_params to prevent issue.
10+
711
## v0.1.5 - 2019-07-20
812
### Changed
913
- Using `Array.wrap` in apply_sort instead of `[].flatten`.

lib/jsonapi/scopes/filters.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def apply_filter(params)
1919
filtering_params = params.dig(:filter) || {}
2020

2121
filtering_params.each do |key, value|
22-
value = value.to_s.split(',').reject(&:blank?)
22+
value = value.to_s.split(',').reject(&:blank?) if value.include?(',')
2323

2424
records = records.public_send(key, value) if @filters.include?(key.to_sym)
2525
end

0 commit comments

Comments
 (0)