summaryrefslogtreecommitdiff
path: root/app/models/acd_agent.rb
diff options
context:
space:
mode:
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