Actions
Refactor #13974
closedRemove nested arrays from AR finder methods
Description
Rails 4.2 deprecates passing nested arrays to AR finders, e.g. Feature.find_by_name([['Puppet']])
should be flattened first.
This is triggered from two places in the codebase. One's in the SmartProxy.with_features call from require_smart_proxy_or_login (smart proxy auth concern) which passes an array into the scope causing nesting:
DEPRECATION WARNING: Passing a nested array to Active Record finder methods is deprecated and will be removed. Flatten your array before using it for 'IN' conditions. (called from block in <class:SmartProxy> at /home/dcleal/code/foreman/foreman/app/models/smart_proxy.rb:41)
The second is in Taxonomix:
DEPRECATION WARNING: Passing a nested array to Active Record finder methods is deprecated and will be removed. Flatten your array before using it for 'IN' conditions. (called from with_taxonomy_scope at /home/dcleal/code/foreman/foreman/app/models/concerns/taxonomix.rb:3
8)
Actions