Missing "belongs_to" causes crash in field_search

6 views
Skip to first unread message

Mike Blyth

unread,
Jan 11, 2013, 10:07:50 AM1/11/13
to actives...@googlegroups.com
My Member model belongs to ResidenceLocation, but somehow the belongs_to statement got commented out. Everything seemed to work except that a field_search that included Residence Location as one of the fields caused a hard-to-track crash. I traced it to line 41 in finder.rb, in the condition_for_column method:

    if self.respond_to?("condition_for_#{column.name}_column")

At that point column is nil (not being found since it didn't have the belong_to, presumably), so column.name causes an exception. That's understandable, but it would be nice to get a error message either there or when even trying to set up a field search that references an undefined (or wrongly defined) field.


Reply all
Reply to author
Forward
0 new messages