theforeman/foreman — pull request #1222 by jmontleon (2014-02-07 04:24:36+00:00)
Title: fixes #4289 - fix issue deleting lookup values for hosts

I do not really understand why the original line is not working. If I change it to find_by_id I get the error message below. I'm not sure why it is looking for managed_id and id, but this change works around it and I am then able to delete lookup_values from the host edit. Maybe there is a better solution?

"Operation FAILED: Mysql2::Error: Unknown column 'lookup_values.managed_id' in 'where clause': SELECT `lookup_values`.* FROM `lookup_values` WHERE `lookup_values`.`managed_id` = 1 AND `lookup_values`.`id` = 1 LIMIT 1"