From 9bb73f3b4332289751a403c2c58385926f355701 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 20 May 2016 10:44:00 +0200 Subject: [PATCH] Improved error handling. --- app/models/application_model.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/application_model.rb b/app/models/application_model.rb index 63dcb5b30..80a9e0259 100644 --- a/app/models/application_model.rb +++ b/app/models/application_model.rb @@ -1148,7 +1148,12 @@ get assets and record_ids of selector send(selector).each {|item, content| attribute = item.split(/\./) next if !attribute[1] - attribute_class = attribute[0].to_classname.constantize + begin + attribute_class = attribute[0].to_classname.constantize + rescue => e + logger.error "Unable to get asset for '#{attribute[0]}': #{e.inspect}" + next + end reflection = attribute[1].sub(/_id$/, '') #reflection = reflection.to_sym next if !models[attribute_class]