diff options
author | spag <spag@golwen.net> | 2013-02-09 10:05:00 +0100 |
---|---|---|
committer | spag <spag@golwen.net> | 2013-02-09 10:05:00 +0100 |
commit | 42a8e4808e343975042730ab3847303184d73b92 (patch) | |
tree | 6a137c40eccf31d6d57e3177bbf09d14c3524b4c /app | |
parent | ff67b61369dba20747babfb642fb2086bbaff4a9 (diff) |
identifier added
Diffstat (limited to 'app')
-rw-r--r-- | app/models/gateway.rb | 5 | ||||
-rw-r--r-- | app/views/gateways/show.xml.haml | 2 |
2 files changed, 6 insertions, 1 deletions
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? diff --git a/app/views/gateways/show.xml.haml b/app/views/gateways/show.xml.haml index 5e2806d..e0ff21a 100644 --- a/app/views/gateways/show.xml.haml +++ b/app/views/gateways/show.xml.haml @@ -1,5 +1,5 @@ !!! XML -%gateway{ :id => @gateway.id, :name => @gateway.name, :technology => @gateway.technology, :inbound => @gateway.inbound.to_s, :outbound => @gateway.outbound.to_s, :description => @gateway.description } +%gateway{ :identifier => @gateway.identifier, :name => @gateway.name, :technology => @gateway.technology, :inbound => @gateway.inbound.to_s, :outbound => @gateway.outbound.to_s, :description => @gateway.description } %gateway_settings{ :count => @gateway.gateway_settings.count } - @gateway.gateway_settings.each do |setting| |