rapid7/metasploit_data_models — pull request #26 by jvennix-r7 (2013-05-21 17:44:16+00:00)
Title: Bug/add table name to hosts search

This fixes an issue in Pro with ambiguous column references when using Mdm::Host.search on an ActiveRecord:Relation that has pulled in a few joins.

To test, run the spec: ./spec/app/models/mdm/host_spec.rb

This is a minor version bump that does not need to go into Framework immediately, since it fixes a bug that is unique to Pro. Long term, we should probably either move all the Mdm::Model.search methods to use arel, or concatenate the "#{self.table_name}." to the front of the column references in every .search implementation (might also be a good idea to extract the search scope into its own concern!)