summaryrefslogtreecommitdiff
path: root/app/models/acd_agent.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-22 12:32:36 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-22 12:32:36 +0100
commitbc4e559c08616de312906903a1c89eb74d09ffd7 (patch)
tree49695b7ea1d4c207f3fc9ea56ada0d35086a5334 /app/models/acd_agent.rb
parent77a3c41cbb7edb93dcc98b7ae18a1b58e0d2d2ef (diff)
GUI improvement for new acd agents.
Diffstat (limited to 'app/models/acd_agent.rb')
-rw-r--r--app/models/acd_agent.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/acd_agent.rb b/app/models/acd_agent.rb
index a00ac4b..4be4700 100644
--- a/app/models/acd_agent.rb
+++ b/app/models/acd_agent.rb
@@ -3,13 +3,19 @@ class AcdAgent < ActiveRecord::Base
STATUSES = ['active', 'inactive']
attr_accessible :uuid, :name, :status, :automatic_call_distributor_id, :last_call, :calls_answered, :destination_type, :destination_id
-
+
belongs_to :automatic_call_distributor
belongs_to :destination, :polymorphic => true
after_save :set_presence
+ # Validations:
+ #
+ validates_presence_of :name
+ validates_presence_of :destination
+ validates_presence_of :destination_id
+
def to_s
self.name || I18n.t('acd_agents.name') + ' ID ' + self.id.to_s
end