We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e20b5a commit ef92decCopy full SHA for ef92dec
2 files changed
test/controllers/controller_test.rb
@@ -104,7 +104,7 @@ def test_index_filter_by_title
104
end
105
106
def test_index_filter_with_hash_values
107
- get :index, {filter: {search: {title: 'New post'}}}
+ get :index, params: {filter: {search: {title: 'New post'}}}
108
assert_response :success
109
assert json_response['data'].is_a?(Array)
110
assert_equal 1, json_response['data'].size
test/fixtures/active_record.rb
@@ -958,7 +958,7 @@ def title=(title)
958
959
filter :search,
960
verify: ->(values, context) {
961
- values.all?{|v| v.is_a?(Hash) } && values
+ values.all?{|v| (v.is_a?(Hash) || v.is_a?(ActionController::Parameters)) } && values
962
},
963
apply: -> (records, values, _options) {
964
records.where(title: values.first['title'])
0 commit comments