summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorspag <spag@golwen.net>2013-01-28 09:26:47 +0100
committerspag <spag@golwen.net>2013-01-28 09:26:47 +0100
commit29ac1a26b5d78c3d8570928df73610de0a361297 (patch)
tree3ec56353f7a9ec3c8a7275708e9ce0c088411cf7 /app/models
parente500814c387818938bfe76299a25a04de7e1cbfb (diff)
render route endpoint
Diffstat (limited to 'app/models')
-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