From bc4e559c08616de312906903a1c89eb74d09ffd7 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sat, 22 Dec 2012 12:32:36 +0100 Subject: GUI improvement for new acd agents. --- app/models/acd_agent.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/models') 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 -- cgit v1.2.3