Project

General

Profile

Actions

Refactor #13974

closed

Remove nested arrays from AR finder methods

Added by Dominic Cleal about 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Rails
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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 #1

Updated by The Foreman Bot about 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3257 added
Actions #2

Updated by Dominic Cleal about 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #3

Updated by Dominic Cleal about 8 years ago

  • translation missing: en.field_release set to 136
Actions

Also available in: Atom PDF