Skip to content

Commit ec7416f

Browse files
committed
Now that Rails uses strong parameters, convert them to a Hash before using in query.
1 parent 06cce1d commit ec7416f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/api/base_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def bad_url
4747
# clause "key = value" is replaced by "key::text ~ value*", where "value*" is
4848
# "value" with the tilde removed.
4949
def query(model, params)
50-
where_params = params.slice(*model.column_names)
50+
where_params = params.permit!.to_hash.slice(*model.column_names)
5151

5252
limit = nil
5353
if params.has_key? "limit"

0 commit comments

Comments
 (0)