We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f48999f commit 55f9ae5Copy full SHA for 55f9ae5
lib/jsonapi/utils/support/filter/custom.rb
@@ -11,12 +11,8 @@ def custom_filters(*attrs)
11
def custom_filter(attr)
12
attr = attr.to_sym
13
@_allowed_filters[attr] = {}
14
-
15
- if !@_allowed_custom_filters.is_a?(Array)
16
- @_allowed_custom_filters = Array(attr)
17
- elsif @_allowed_custom_filters.include?(attr)
18
- @_allowed_custom_filters.push(attr)
19
- end
+ @_allowed_custom_filters ||= []
+ @_allowed_custom_filters |= [attr]
20
end
21
22
0 commit comments