summaryrefslogtreecommitdiff
path: root/app/models/gateway.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/gateway.rb')
-rw-r--r--app/models/gateway.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/gateway.rb b/app/models/gateway.rb
index a8df41f..2f17b57 100644
--- a/app/models/gateway.rb
+++ b/app/models/gateway.rb
@@ -1,10 +1,12 @@
class Gateway < ActiveRecord::Base
TECHNOLOGIES = ['sip', 'xmpp']
+ GATEWAY_PREFIX = 'gateway'
attr_accessible :name, :technology, :inbound, :outbound, :description
has_many :gateway_settings, :dependent => :destroy
has_many :gateway_parameters, :dependent => :destroy
+ has_many :call_routes, :as => :endpoint, :dependent => :nullify
validates :name,
:presence => true,
@@ -21,6 +23,10 @@ class Gateway < ActiveRecord::Base
name
end
+ def identifier
+ "#{GATEWAY_PREFIX}#{self.id}"
+ end
+
private
def downcase_technology
self.technology = self.technology.downcase if !self.technology.blank?