Fixed generic object_lookup(). For Roy, 'refs 123'.

This commit is contained in:
Martin Edenhofer 2012-11-07 17:38:09 +01:00
parent 3525ad79a9
commit f57e15e984

View file

@ -411,8 +411,9 @@ class Channel::EmailParser
def object_lookup( attributes, map, mail )
map.each { |item|
if mail[ item[0].to_sym ]
if item[1].where( item[3].to_sym => mail[ item[0].to_sym ] ).first
attributes[ item[2].to_sym ] = item[1].where( "lower(#{item[3]}) = ?", mail[ item[0].to_sym ].downcase ).first.id
new_object = item[1].where( "lower(#{item[3]}) = ?", mail[ item[0].to_sym ].downcase ).first
if new_object
attributes[ item[2].to_sym ] = new_object.id
end
end
}