Fix issue where trying to add a polymorphic field in search form resulted in NameError

Fixes #159
Fixes #313
Merge remote-tracking branch 'upstream/master'

Conflicts:
	spec/spec_helper.rb