summaryrefslogtreecommitdiff
path: root/app/models/call_route.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/call_route.rb')
-rw-r--r--app/models/call_route.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/call_route.rb b/app/models/call_route.rb
index 28120c1..b4496ab 100644
--- a/app/models/call_route.rb
+++ b/app/models/call_route.rb
@@ -238,4 +238,15 @@ class CallRoute < ActiveRecord::Base
end
end
end
+
+ def endpoint
+ if self.endpoint_id.to_i > 0
+ begin
+ return self.endpoint_type.camelize.constantize.where(:id => self.endpoint_id.to_i).first
+ rescue
+ return nil
+ end
+ end
+ end
+
end