Project

General

Profile

« Previous | Next » 

Revision 4260bb26

Added by Daniel Lobato Garcia over 7 years ago

Fixes #17457 - multiple_checkboxes doesn't work with orgs/locs

multiple_checkboxes calls ActiveModel::Naming on associations that could
be simply "Taxonomy". This results on a 500 error 'undefined method
`taxonomies' for #<Filter:0x005593624bdd18>' (or whatever other class
has the problem). Simply trying to edit a filter will throw this 500
error.

We've always had this problem , but since #16971 removed the check for
only using that method for '> 5' associations, you'd only see the error
if you had at least 6 organizations or locations (unlikely). Now it
became more apparent and it shows up every time.

The fix I've used is just to take advantage of the options hash to send
the association name directly, and if it's not set, then use
ActiveModel::Naming to get it (as usual).

(cherry picked from commit 46ab6100609e769faeaca3a475b31445a8d72b3d)

  • added
  • modified
  • copied
  • renamed
  • deleted