From db31cc867b1e99b4d388b1835dbaec2ad845c29a Mon Sep 17 00:00:00 2001 From: spag Date: Sat, 9 Feb 2013 09:50:54 +0100 Subject: gateway has routes --- app/models/gateway.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/models/gateway.rb') diff --git a/app/models/gateway.rb b/app/models/gateway.rb index a8df41f..eea1e33 100644 --- a/app/models/gateway.rb +++ b/app/models/gateway.rb @@ -5,6 +5,7 @@ class Gateway < ActiveRecord::Base has_many :gateway_settings, :dependent => :destroy has_many :gateway_parameters, :dependent => :destroy + has_many :call_routes, :as => :endpoint, :dependent => :nullify validates :name, :presence => true, -- cgit v1.2.3 From 42a8e4808e343975042730ab3847303184d73b92 Mon Sep 17 00:00:00 2001 From: spag Date: Sat, 9 Feb 2013 10:05:00 +0100 Subject: identifier added --- app/models/gateway.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/models/gateway.rb') diff --git a/app/models/gateway.rb b/app/models/gateway.rb index eea1e33..2f17b57 100644 --- a/app/models/gateway.rb +++ b/app/models/gateway.rb @@ -1,5 +1,6 @@ class Gateway < ActiveRecord::Base TECHNOLOGIES = ['sip', 'xmpp'] + GATEWAY_PREFIX = 'gateway' attr_accessible :name, :technology, :inbound, :outbound, :description @@ -22,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? -- cgit v1.2.3