summaryrefslogtreecommitdiff
path: root/app/models/acd_agent.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-22 12:35:08 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-22 12:35:08 +0100
commit3e76142566ad8f55a64a88fe5c19e7d0ec7c11c0 (patch)
tree49695b7ea1d4c207f3fc9ea56ada0d35086a5334 /app/models/acd_agent.rb
parent8192bd2ba0e72513e6750015a3367e8bf1ab7734 (diff)
parent65f95f2b6b8bca179c1db20cfb1769738f0b9d9b (diff)
Merge branch 'develop'5.0.0
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